diff options
author | Brecht Van Lommel <brecht@blender.org> | 2023-01-25 05:47:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 23:47:53 -0500 |
commit | c8139c0f642a308b544d2f17e7b728ee6762a0eb (patch) | |
tree | 0b29563e5a3fe8511e18a1eb6f2cfdf2453fc88a /services/pull/pull.go | |
parent | a31fedd2c2def13e29a962c751c449491d5a1588 (diff) | |
download | gitea-c8139c0f642a308b544d2f17e7b728ee6762a0eb.tar.gz gitea-c8139c0f642a308b544d2f17e7b728ee6762a0eb.zip |
Webhooks: for issue close/reopen action, add commit ID that caused it (#22583)
The `commit_id` property name is the same as equivalent functionality in
GitHub. If the action was not caused by a commit, an empty string is
used.
This can for example be used to automatically add a Resolved label to an
issue fixed by a commit, or clear it when the issue is reopened.
Diffstat (limited to 'services/pull/pull.go')
-rw-r--r-- | services/pull/pull.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go index 08f70a5e4e..7f81def6d6 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -532,7 +532,7 @@ func CloseBranchPulls(doer *user_model.User, repoID int64, branch string) error var errs errlist for _, pr := range prs { - if err = issue_service.ChangeStatus(pr.Issue, doer, true); err != nil && !issues_model.IsErrPullWasClosed(err) && !issues_model.IsErrDependenciesLeft(err) { + if err = issue_service.ChangeStatus(pr.Issue, doer, "", true); err != nil && !issues_model.IsErrPullWasClosed(err) && !issues_model.IsErrDependenciesLeft(err) { errs = append(errs, err) } } @@ -566,7 +566,7 @@ func CloseRepoBranchesPulls(ctx context.Context, doer *user_model.User, repo *re if pr.BaseRepoID == repo.ID { continue } - if err = issue_service.ChangeStatus(pr.Issue, doer, true); err != nil && !issues_model.IsErrPullWasClosed(err) { + if err = issue_service.ChangeStatus(pr.Issue, doer, "", true); err != nil && !issues_model.IsErrPullWasClosed(err) { errs = append(errs, err) } } |