Skip to content

Commit

Permalink
fix: skip check if changes array is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ElfenB committed Jun 3, 2024
1 parent 202ce48 commit 503789f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jenkins/webhook-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,10 @@ func (s *Server) HandleRoot() http.HandlerFunc {
// Skip requests with where the ref id is starting with "refs/notes/"
// Reference 1: https://community.atlassian.com/t5/Bitbucket-questions/disable-quot-git-notes-add-quot-behaviour-for-semantic-release/qaq-p/1837322
// Reference 2: https://github.com/semantic-release/semantic-release/discussions/2017#discussioncomment-995308
if strings.Contains(req.Changes[0].Ref.DisplayID, "refs/notes/") {
if len(req.Changes) > 0 && strings.Contains(req.Changes[0].Ref.DisplayID, "refs/notes/") {
log.Println(requestID, "Skipping request with refs/notes/ prefix in ref id")
// Return 200 OK to Bitbucket to avoid retries
http.Error(w, "OK", http.StatusOK)
return
}

Expand Down

0 comments on commit 503789f

Please sign in to comment.