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

Revert "fix: also cascade if run-*-test is set when the PR is open (#948)" (#950)

This reverts commit 1178cf6d24.

This was an incorrect fix to a different problem. The `labeled` event is run when a pull request is opened. Adding an `opened` event will just needlessly duplicate the runs.

The actual problem was me assuming too quickly that a short runtime (15s) indicated that the cascade was not run.

This is what happened at https://code.forgejo.org/forgejo/runner/pulls/935

- the cascade is run https://code.forgejo.org/forgejo/runner/pulls/935#issuecomment-57986
- the duration is very short because the commit status is set [by the last event (closed)](https://code.forgejo.org/forgejo/runner/actions/runs/9344/jobs/0#jobstep-1-12)
  ![image](/attachments/2aecc2f6-8fc0-4778-91c3-de689808a30e)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/950): <!--number 950 --><!--line 0 --><!--description UmV2ZXJ0ICJmaXg6IGFsc28gY2FzY2FkZSBpZiBydW4tKi10ZXN0IGlzIHNldCB3aGVuIHRoZSBQUiBpcyBvcGVuICgjOTQ4KSI=-->Revert "fix: also cascade if run-*-test is set when the PR is open (#948)"<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/950
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
Earl Warren 2025-09-08 00:14:44 +00:00 committed by earl-warren
parent 16cb2d5b75
commit ad90bb4b68
No known key found for this signature in database
GPG key ID: F128CBE6AB3A7201
2 changed files with 4 additions and 6 deletions

View file

@ -28,7 +28,6 @@ on:
- 'wip-cascade'
pull_request_target:
types:
- opened
- synchronize
- labeled
- closed
@ -64,7 +63,7 @@ jobs:
# Always run when a commit is pushed to the main or wip-cascade branch
# 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 or opened) if the `run-forgejo-tests` is already present
# - 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: >
@ -74,7 +73,7 @@ jobs:
) || (
forge.event_name == 'pull_request_target' && (
forge.event.action == 'closed' ||
( ( forge.event.action == 'synchronized' || forge.event.action == 'opened' ) && contains(forge.event.pull_request.labels.*.name, 'run-forgejo-tests') ) ||
( 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' )
)
)

View file

@ -27,7 +27,6 @@ on:
- 'wip-cascade'
pull_request_target:
types:
- opened
- synchronize
- labeled
- closed
@ -63,7 +62,7 @@ jobs:
# Always run when a commit is pushed to the wip-cascade branch
# If this is a pull request, run
# - when the `run-end-to-end-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 or opened) if the `run-end-to-end-tests` is already present
# - when a new commit is pushed to the pull request (synchronized) if the `run-end-to-end-tests` is already present
# - when the pull request is closed, which also happens when it is merged, so that the setup-forgejo & end-to-end pull requests are closed
#
if: >
@ -73,7 +72,7 @@ jobs:
) || (
forge.event_name == 'pull_request_target' && (
forge.event.action == 'closed' ||
( ( forge.event.action == 'synchronized' || forge.event.action == 'opened' ) && contains(forge.event.pull_request.labels.*.name, 'run-end-to-end-tests') ) ||
( forge.event.action == 'synchronized' && contains(forge.event.pull_request.labels.*.name, 'run-end-to-end-tests') ) ||
( forge.event.action == 'label_updated' && forge.event.label.name == 'run-end-to-end-tests' )
)
)