Skip to content

Commit

Permalink
Fix broken getPrFileNames() function (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
posquit0 authored Oct 24, 2020
1 parent fec7e8d commit 9d5eff2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/labeler.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@ func (l *Labeler) findMatches(pr *gh.PullRequest, config *LabelerConfigV1) (Labe
// getPrFileNames returns all of the file names (old and new) of files changed in the given PR
func getPrFileNames(pr *gh.PullRequest) ([]string, error) {
ghToken := os.Getenv("GITHUB_TOKEN")
diffReq, err := http.NewRequest("GET", pr.GetDiffURL(), nil)
diffReq, err := http.NewRequest("GET", pr.GetURL(), nil)

if err != nil {
return nil, err
}

diffReq.Header.Add("Authorization", "Bearer "+ghToken)
diffReq.Header.Add("Accept", "application/vnd.github.v3.diff")
diffRes, err := http.DefaultClient.Do(diffReq)

if err != nil {
Expand Down

0 comments on commit 9d5eff2

Please sign in to comment.