Backport: Skip pull_request triggered runs in private repos - 5.7 Branch - #12980
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 5.7 Branch#12980desrosj 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.7 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The
5.7branch only has 5 workflow files (coding-standards.yml,javascript-tests.yml,php-compatibility.yml,phpunit-tests.yml,test-build-processes.yml), so the majority of the original commit does not apply.Hunks dropped because the file does not exist on
5.7(the cherry-pick tried to create each of these as a new file; all weregit rm'd):.github/workflows/end-to-end-tests.yml.github/workflows/javascript-type-checking.yml.github/workflows/performance.yml.github/workflows/phpstan-static-analysis.yml.github/workflows/test-and-zip-default-themes.yml.github/workflows/upgrade-develop-testing.yml(no equivalentupgrade-testing.ymlon this branch either).github/workflows/workflow-lint.ymlBecause
upgrade-develop-testing.ymlandworkflow-lint.ymldo not exist here, the companion part of the original commit that switched those two workflows fromuses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunktouses: ./.github/workflows/<x>.ymlwas not carried over. Noreusable-*.ymlworkflow files exist on this branch, so that change would not have been valid regardless.Files that conflicted textually and how they were resolved:
coding-standards.yml— thephpcsjob conflicted because5.7has an extrawith: php-version: '7.4'block immediately after theif:. Resolved by taking the new multi-lineif:and keeping the branch'swith:block. Thejshintjob in the same file merged cleanly.javascript-tests.yml— thetest-jsjob conflicted for the same reason (5.7haswith: disable-apparmor: trueafter theif:). Resolved the same way.php-compatibility.yml— thephp-compatibilityjob conflicted for the same reason (with: php-version: '7.4'). Resolved the same way.phpunit-tests.yml— heavily conflicted.5.7has a singletest-phpjob usingreusable-phpunit-tests-v2.yml, while trunk hasprepare-gutenberg,test-with-mysql,test-with-mariadb,test-with-sqlite, and a fork-only job. The file was restored fromupstream/5.7and the new condition was applied by hand to the one job in the family,test-php. All trunk-only jobs and their conditions were dropped, including the fork-only! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request'variant, which has no counterpart on this branch.test-build-processes.yml— merged cleanly for thetest-core-build-processjob.Intentionally left unchanged:
slack-notificationsandfailed-workflowjobs (gated ongithub.event_name != 'pull_request', unaffected by this change).test-build-processes.yml'stest-core-build-process-macosjob, whose condition isgithub.repository == 'WordPress/wordpress-develop'only — it is not in the|| github.event_name == 'pull_request'family and was not touched by the original commit.Verification:
git diff upstream/5.7 --statshows only the 5 files above, all under.github/workflows/. No conflict markers remain, and all 5 changed files parse as valid YAML with their expected job lists intact.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.