]> source.dussan.org Git - gitea.git/commit
Fix `ref` for workflows triggered by `pull_request_target` (#25743)
authorZettat123 <zettat123@gmail.com>
Fri, 7 Jul 2023 19:22:03 +0000 (03:22 +0800)
committerGitHub <noreply@github.com>
Fri, 7 Jul 2023 19:22:03 +0000 (19:22 +0000)
commita42a838843771de729ce4e9b7b9146186c072cd4
tree60ddf41bf2bc393101bcc092038343109f4b5f08
parent811fc9d49c7f2ef128780d9b1a8dac31831f1f7b
Fix `ref` for workflows triggered by `pull_request_target` (#25743)

Follow #25229

At present, when the trigger event is `pull_request_target`, the `ref`
and `sha` of `ActionRun` are set according to the base branch of the
pull request. This makes it impossible for us to find the head branch of
the `ActionRun` directly. In this PR, the `ref` and `sha` will always be
set to the head branch and they will be changed to the base branch when
generating the task context.
modules/actions/workflows.go
routers/api/actions/runner/utils.go
services/actions/notifier_helper.go
tests/integration/actions_trigger_test.go