Skip to content

Commit 49c0b0f

Browse files
authored
Merge pull request #76 from kolomied/issue/75
Add support for GITHUB_EVENT_PATH variable
2 parents fe0dc24 + 9227b4d commit 49c0b0f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/commenter/commenter.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ More information available %s`,
110110
}
111111

112112
func extractPullRequestNumber() (int, error) {
113-
github_event_file := "/github/workflow/event.json"
113+
github_event_file := os.Getenv("GITHUB_EVENT_PATH")
114+
if github_event_file == "" {
115+
github_event_file = "/github/workflow/event.json"
116+
}
117+
114118
file, err := ioutil.ReadFile(github_event_file)
115119
if err != nil {
116120
fail(fmt.Sprintf("GitHub event payload not found in %s", github_event_file))

0 commit comments

Comments
 (0)