Skip to content

Commit

Permalink
renamed var commit_hash -> commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 22, 2024
1 parent edcd28b commit e35a606
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/pkg/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func NewGithub() *Github {
}

// VerifyGithubToken verifies the github token
// /repos/:owner/:repo/statuses/commit_hash
func (g *Github) VerifyGithubToken(token, orgName, repoName, commitHash string) error {
// /repos/:owner/:repo/statuses/commit
func (g *Github) VerifyGithubToken(token, orgName, repoName, commit string) error {
if token == "" {
err := errors.New("token is empty")
g.log.Error(err)
Expand All @@ -46,7 +46,7 @@ func (g *Github) VerifyGithubToken(token, orgName, repoName, commitHash string)
return nil
}

url := g.getEndpoint(g.api, orgName, repoName, commitHash)
url := g.getEndpoint(g.api, orgName, repoName, commit)

req, err := http.NewRequest("POST", url, g.body)
if err != nil {
Expand All @@ -70,8 +70,8 @@ func (g *Github) VerifyGithubToken(token, orgName, repoName, commitHash string)
return err
}

func (g *Github) getEndpoint(api, orgName, repoName, commitHash string) string {
return fmt.Sprintf("%s/repos/%s/%s/statuses/%s", api, orgName, repoName, commitHash)
func (g *Github) getEndpoint(api, orgName, repoName, commit string) string {
return fmt.Sprintf("%s/repos/%s/%s/statuses/%s", api, orgName, repoName, commit)
}

func (g *Github) setHeader(req *http.Request, token string) {
Expand Down

0 comments on commit e35a606

Please sign in to comment.