From 9d5eff2ad5c23ff73c897833443ea9bb431d36c9 Mon Sep 17 00:00:00 2001 From: "Byungjin Park (BJ)" Date: Sat, 24 Oct 2020 22:13:03 +0900 Subject: [PATCH] Fix broken getPrFileNames() function (#20) --- pkg/labeler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/labeler.go b/pkg/labeler.go index d1cea65..b824bfd 100644 --- a/pkg/labeler.go +++ b/pkg/labeler.go @@ -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 {