Skip to content

Commit

Permalink
fix(api/webhook): build approval for fork-no-write (#1088)
Browse files Browse the repository at this point in the history
* fix(api/webhook): build approval for fork-no-write

* chore: address linter feedback
  • Loading branch information
jbrockopp committed Mar 20, 2024
1 parent 1809638 commit 7a6e89a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/webhook/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ func PostWebhook(c *gin.Context) {

// if the webhook was from a Pull event from a forked repository, verify it is allowed to run
if webhook.PullRequest.IsFromFork {
logrus.Tracef("inside %s workflow for fork PR build %s/%d", repo.GetApproveBuild(), r.GetFullName(), b.GetNumber())

switch repo.GetApproveBuild() {
case constants.ApproveForkAlways:
err = gatekeepBuild(c, b, repo, u)
Expand All @@ -782,7 +784,7 @@ func PostWebhook(c *gin.Context) {
return
}

fallthrough
logrus.Debugf("fork PR build %s/%d automatically running without approval", repo.GetFullName(), b.GetNumber())
case constants.ApproveOnce:
// determine if build sender is in the contributors list for the repo
//
Expand Down

0 comments on commit 7a6e89a

Please sign in to comment.