CI: Skip workflow jobs that should not run on forks#77081
Open
dd32 wants to merge 1 commit intoWordPress:trunkfrom
Open
CI: Skip workflow jobs that should not run on forks#77081dd32 wants to merge 1 commit intoWordPress:trunkfrom
dd32 wants to merge 1 commit intoWordPress:trunkfrom
Conversation
Several workflow jobs were running (and one was failing) on push events to forked repositories despite their parent jobs being correctly gated. - unit-test.yml: The unit-php aggregator job ran with `if: always()`, so when test-php and phpcs were skipped on forks it evaluated `needs.test-php.result != 'success'` and exited 1, marking every fork push as failed. - end2end-test.yml: merge-artifacts ran with only `!cancelled()`, so it spun up a runner on every fork push for nothing. - sync-backport-changelog.yml: had no fork guard at all and tried to update issues in the fork repository on every push to trunk. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Member
Author
|
The above is Claude-generated. The reason I was looking into this was that my personal free GitHub actions usage/actions-storage was being used up in a matter of days, Gutenberg (behind Playground) was the largest user of resources. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds fork-repository guards to three workflow jobs that currently run (and in one case, fail) on every push to
trunkin forked repositories.Why
When syncing a fork of
WordPress/gutenberg, every push totrunktriggers workflow runs. Most jobs are correctly gated withgithub.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request', but three are not:unit-test.yml→unit-phpaggregator job — gated only byif: always(). Whentest-phpandphpcsare skipped on a fork, this job runs and evaluatesneeds.test-php.result != 'success'. Sinceskipped != success, it exits 1, marking every fork push as a failed Unit Tests run. This is the most visible problem — forks see a red ❌ on every commit synced from upstream.end2end-test.yml→merge-artifactsjob — gated only byif: !cancelled(). The upstreame2e-playwrightjob is correctly skipped on forks, butmerge-artifactsstill spins up a runner, checks out the repo, and runsnpm installfor nothing.sync-backport-changelog.yml— has no fork guard at all. On every push totrunkin a fork it attempts to look up an issue with the🤖 Sync Backport Changeloglabel in the fork itself, which is meaningless outside ofWordPress/gutenberg.How
Each job now also checks
github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request', matching the guard already used by the sibling jobs in the same workflows.Testing instructions
pull_requestbranch of the condition is unchanged).trunkshould no longer show the failingUnit Testsrun, theMerge Artifactsjob should be skipped, andSync Core Backport Issueshould not run.🤖 Generated with Claude Code