1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

chore: cascade forgejo pull request out of the runner branch or PR (followup)

Also run the workflow when the pull request is closed so that it
closes the forgejo pull request. It would otherwise clutter the pull
request list and require manual intervention.
This commit is contained in:
Earl Warren 2025-08-18 14:07:20 +02:00
parent d78c75f7c0
commit f793c00981
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -30,6 +30,7 @@ on:
types:
- synchronize
- labeled
- closed
enable-email-notifications: true
@ -63,6 +64,7 @@ jobs:
# If this is a pull request, run
# - when the `run-forgejo-tests` label is set (label_updated) (but not if another label is set or if a label is removed)
# - when a new commit is pushed to the pull request (synchronized) if the `run-forgejo-tests` is already present
# - when the pull request is closed, which also happens when it is merged, so that the Forgejo pull request is closed
#
if: >
vars.ROLE == 'forgejo-coding' && (
@ -70,6 +72,7 @@ jobs:
forge.event_name == 'push' && ( forge.ref_name == 'main' || forge.ref_name == 'wip-cascade')
) || (
forge.event_name == 'pull_request_target' && (
forge.event.action == 'closed' ||
( forge.event.action == 'synchronized' && contains(forge.event.pull_request.labels.*.name, 'run-forgejo-tests') ) ||
( forge.event.action == 'label_updated' && forge.event.label.name == 'run-forgejo-tests' )
)