From f793c00981fc96cd9e2fea6294587d2d29b944e1 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 18 Aug 2025 14:07:20 +0200 Subject: [PATCH] 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. --- .forgejo/workflows/cascade-forgejo.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.forgejo/workflows/cascade-forgejo.yml b/.forgejo/workflows/cascade-forgejo.yml index 1f371dfd..15063e7a 100644 --- a/.forgejo/workflows/cascade-forgejo.yml +++ b/.forgejo/workflows/cascade-forgejo.yml @@ -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' ) )