Skip to content

Commit 7978a96

Browse files
committed
make issueID private
1 parent 63e37a7 commit 7978a96

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

main.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ import (
2121
func main() {
2222
payload := issueEventPayload()
2323

24-
// Get issue ID from payload to put it on designated GitHub project
25-
issueID := IssueID(payload)
24+
issueID := extractIssueID(payload)
2625
infoLog("New issue is found!!")
2726
debugLog("Issue ID: %d\n", issueID)
2827

2928
client, ctx := getGitHubClient()
3029

31-
// Project type investigation
3230
url := os.Getenv("GITHUB_PROJECT_URL")
3331
if url == "" {
32+
log.Println("[ERROR] Environment variable GITHUB_PROJECT_URL is not defined in your workflow file")
3433
os.Exit(1)
3534
}
3635

@@ -117,8 +116,8 @@ func issueEventPayload() github.IssuesEvent {
117116
return payload
118117
}
119118

120-
// IssueID returns GitHub issue ID to place onto the designated GitHub project
121-
func IssueID(payload github.IssuesEvent) int64 {
119+
// extractIssueID returns GitHub issue ID extracted from event payloads
120+
func extractIssueID(payload github.IssuesEvent) int64 {
122121
return payload.GetIssue().GetID()
123122
}
124123

0 commit comments

Comments
 (0)