mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
fix: Actions PR workflows must update the commit status
When a workflow has on: pull_request: types: - labeled - unlabeled The outcome of the workflow (success or failure) must be associated with the head sha commit status. Otherwise it cannot be used as a requirement for merging the pull request (branch protections).
This commit is contained in:
parent
58e3c1fbdb
commit
66c85b7d8b
3 changed files with 242 additions and 2 deletions
|
@ -146,7 +146,11 @@ func (run *ActionRun) GetPushEventPayload() (*api.PushPayload, error) {
|
|||
}
|
||||
|
||||
func (run *ActionRun) GetPullRequestEventPayload() (*api.PullRequestPayload, error) {
|
||||
if run.Event == webhook_module.HookEventPullRequest || run.Event == webhook_module.HookEventPullRequestSync {
|
||||
if run.Event == webhook_module.HookEventPullRequest ||
|
||||
run.Event == webhook_module.HookEventPullRequestSync ||
|
||||
run.Event == webhook_module.HookEventPullRequestAssign ||
|
||||
run.Event == webhook_module.HookEventPullRequestMilestone ||
|
||||
run.Event == webhook_module.HookEventPullRequestLabel {
|
||||
var payload api.PullRequestPayload
|
||||
if err := json.Unmarshal([]byte(run.EventPayload), &payload); err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue