Skip to content

Commit

Permalink
fix: checking for errors when converting GitHub App and Installation IDs
Browse files Browse the repository at this point in the history
Signed-off-by: Dustin Lactin <[email protected]>
  • Loading branch information
dlactin committed Dec 7, 2023
1 parent 6ea67ef commit 674a9fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/argocd/gitcreds.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ func getCredsFromSecret(wbc *WriteBackConfig, credentialsSecret string, kubeClie
return nil, fmt.Errorf("invalid secret %s: does not contain field githubAppPrivateKey", credentialsSecret)
}
// converting byte array to string and ultimately int64 for NewGitHubAppCreds
intGithubAppID, _ := strconv.ParseInt(string(githubAppID), 10, 64)
intGithubAppID, err := strconv.ParseInt(string(githubAppID), 10, 64)
if err != nil {
return nil, err
}
intGithubAppInstallationID, _ := strconv.ParseInt(string(githubAppInstallationID), 10, 64)
if err != nil {
return nil, err
}
return git.NewGitHubAppCreds(intGithubAppID, intGithubAppInstallationID, string(githubAppPrivateKey), "", "", "", "", true), nil
} else if username, ok = credentials["username"]; ok {
if password, ok = credentials["password"]; !ok {
Expand Down

0 comments on commit 674a9fe

Please sign in to comment.