Backport: Skip pull_request triggered runs in private repos - 5.3 Branch - #12987
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 5.3 Branch#12987desrosj wants to merge 1 commit into
desrosj wants to merge 1 commit into
Conversation
This modifies the conditions for GitHub Actions workflow runs so that they do not run within private forks and mirrors for `pull_request` events when the PR is in `draft` status. For situations where this may be desirable, a `Draft Workflow Runs` label can be added to a `draft` pull request to force workflows to run. Props desrosj, jorbin. See #65848. git-svn-id: https://develop.svn.wordpress.org/trunk@63183 602fd350-edb4-49c9-b593-d223f7449a82
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
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.
This backports 15c4b04 (r63183) to the 5.3 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The 5.3 branch has only four workflow files in
.github/workflows/:coding-standards.yml,javascript-tests.yml,phpunit-tests.yml, andtest-build-processes.yml. Eight of the twelve files touched by the original commit do not exist on this branch, and the two files that conflicted textually differ structurally from trunk.Files dropped entirely (do not exist on 5.3, and have no equivalent here)
The cherry-pick tried to create these as new files because they are absent on 5.3. Each was
git rm'd so no new workflow file is introduced by this backport:end-to-end-tests.ymljavascript-type-checking.ymlperformance.ymlphp-compatibility.ymlphpstan-static-analysis.ymltest-and-zip-default-themes.ymlupgrade-develop-testing.yml(5.3 has noupgrade-testing.ymlequivalent either)workflow-lint.ymlBecause
upgrade-develop-testing.ymlandworkflow-lint.ymldo not exist here, the original commit's change fromuses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunktouses: ./.github/workflows/<x>.ymlwas not carried over. 5.3 has no localreusable-*.ymlfiles at all, so that piece is not applicable to this branch.coding-standards.yml— conflicted (content)Both the
phpcsandjshintjobs matched the target pattern and both received the new condition.The
phpcsjob conflicted because on 5.3 theif:line is immediately followed by awith:block that does not exist on trunk:Resolved by replacing only the
if:expression and preserving thatwith:block unchanged. Thejshintjob merged cleanly.javascript-tests.yml— conflicted (content)The
test-jsjob conflicted for the same reason: on 5.3 theif:line is followed by awith: disable-apparmor: trueblock not present on trunk. Resolved by replacing only theif:expression and preserving thewith:block.phpunit-tests.yml— conflicted (content), resolved by handThis was the largest divergence. Trunk has six jobs in this file (
prepare-gutenberg,test-with-mysql,test-with-mariadb,test-with-sqlite, a fork-only job, plus notifications); 5.3 has a singletest-phpjob that callsreusable-phpunit-tests-v2.yml. The three-way merge tried to splice trunk's job structure into this file.Resolution: the 5.3 version of the file was restored in full (
git checkout HEAD -- .github/workflows/phpunit-tests.yml) and the condition was applied by hand to the one job that matches the target pattern,test-php. Itssecrets: inheritline (5.3-only) is preserved above the newif:. The trunk hunks fortest-with-mysql,test-with-mariadb,test-with-sqlite, and the fork-only! startsWith( github.repository, 'WordPress/' )job were dropped because none of those jobs exist on this branch. Consequently nostartsWith( github.repository, 'WordPress/' ) && ( ... )variant appears in this backport.test-build-processes.yml— merged cleanlyThe
test-core-build-processjob merged without conflict. Thetest-core-build-process-macosjob was deliberately left alone: its gate isif: ${{ github.repository == 'WordPress/wordpress-develop' }}, which is not part of the|| github.event_name == 'pull_request'family and is unaffected by the original commit.Not touched
slack-notificationsandfailed-workflowjobs in all four files are gated ongithub.event_name != 'pull_request'and were left unchanged, per the original commit.Verification
git diff upstream/5.3 --statshows only the four files above, all under.github/workflows/..github.Use of AI Tools
This pull request was created by an AI agent (Claude Code). Until this PR is marked "Ready for Review", treat it as untrusted, AI-created code that requires a manual review by a human team member.