]> source.dussan.org Git - gitea.git/commit
Fix activity type match in `matchPullRequestEvent` (#25746)
authorZettat123 <zettat123@gmail.com>
Fri, 7 Jul 2023 16:30:07 +0000 (00:30 +0800)
committerGitHub <noreply@github.com>
Fri, 7 Jul 2023 16:30:07 +0000 (16:30 +0000)
commit7586b5815ac503d6d3d0f37248da0c9cefd08ba5
tree7eb93f51e05e40614cf18f3f8cd114c0f78376f4
parent128d77a3a05c3bde86d5e1f2ac299dbd9c434e2d
Fix activity type match in `matchPullRequestEvent` (#25746)

Fix #25736
Caused by #24048

Right now we only check the activity type for `pull_request` event when
`types` is specified or there are no `types` and filter. If a workflow
only specifies filters but no `types` like this:
```
on:
  pull_request:
    branches: [main]
```
the workflow will be triggered even if the activity type is not one of
`[opened, reopened, sync]`. We need to check the activity type in this
case.

Co-authored-by: Giteabot <teabot@gitea.io>
modules/actions/workflows.go
modules/actions/workflows_test.go