Backport: Skip pull_request triggered runs in private repos - 5.4 Branch - #12979
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 5.4 Branch#12979desrosj 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.4 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The 5.4 branch has only 4 workflow files, so most of the original commit does not apply here.
Files updated (5 jobs total):
.github/workflows/coding-standards.yml—phpcsandjshintjobs..github/workflows/javascript-tests.yml—test-jsjob..github/workflows/phpunit-tests.yml—test-phpjob..github/workflows/test-build-processes.yml—test-core-build-processjob.All five received the canonical replacement condition verbatim:
Hunks dropped because the file does not exist on the 5.4 branch (these came through the cherry-pick as
modify/deleteconflicts and weregit rm'd):.github/workflows/end-to-end-tests.yml.github/workflows/javascript-type-checking.yml.github/workflows/performance.yml.github/workflows/php-compatibility.yml.github/workflows/phpstan-static-analysis.yml.github/workflows/test-and-zip-default-themes.yml.github/workflows/upgrade-develop-testing.yml.github/workflows/workflow-lint.ymlContent conflicts and how they were resolved:
coding-standards.yml,javascript-tests.yml,phpunit-tests.ymlall conflicted textually. In each case the conflict was caused by trailing context that differs on 5.4 (with: php-version: '7.3',with: disable-apparmor: true, andsecrets: inheritrespectively) sitting directly adjacent to theif:line. These three files were reset to their 5.4 state and the condition was applied by hand so no unrelated trunk-only context leaked in.phpunit-tests.ymlon 5.4 has a singletest-phpjob that callsreusable-phpunit-tests-v2.yml. Trunk'sprepare-gutenberg,test-with-mysql,test-with-mariadb,test-with-sqlite,test-old-branches, and the fork-onlytest-with-mysql-forksjobs do not exist here, so thestartsWith( github.repository, 'WordPress/' ) && (...)and! startsWith( ... )variants from the original commit have no target on this branch and were dropped.test-build-processes.ymlauto-merged cleanly fortest-core-build-process. Itstest-core-build-process-macosjob is gated only ongithub.repository == 'WordPress/wordpress-develop'(nopull_requestclause), so it is not part of the affected family and was deliberately left alone.Not carried over:
uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk→uses: ./.github/workflows/<x>.ymlchange fromupgrade-develop-testing.ymlandworkflow-lint.yml: neither file exists on 5.4.slack-notifications) andfailed-workflowjobs across all four files: gated ongithub.event_name != 'pull_request', unaffected by this change.Nothing outside
.github/workflows/was touched. All four changed files were verified to parse as valid YAML and contain no conflict markers.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.