Backport: Skip pull_request triggered runs in private repos - 5.9 Branch - #12989
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 5.9 Branch#12989desrosj 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.9 branch.
Merge Conflict Resolution
The 5.9 branch has a much smaller and older set of workflow files than
trunk, so the cherry-pick conflicted. Notes on exactly what was applied, dropped, and hand-edited:Files from the original commit that do not exist on 5.9 (dropped entirely)
These came through as
modify/deleteconflicts (the commit modified them, 5.9 does not have them). They weregit rm'd so that the backport does not introduce brand new workflow files onto this branch:.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.github/workflows/workflow-lint.ymlBecause
upgrade-develop-testing.ymlandworkflow-lint.ymldo not exist on 5.9, the 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-build-package.yml,reusable-upgrade-testing.yml, orreusable-workflow-lint.ymlexists on this branch either, so no localuses:reference would resolve.Files that applied cleanly
.github/workflows/end-to-end-tests.yml–e2e-testsjob..github/workflows/test-build-processes.yml–test-core-build-processjob.Files that conflicted and were resolved by hand
In each of these, the 5.9 version of the job differs from
trunk(extrawith:blocks,secrets: inheritinstead of named secrets, different job names/structure), so the surrounding lines did not match. The 5.9 content was kept as-is and only theif:expression was replaced with the new condition:.github/workflows/coding-standards.yml–phpcsjob (conflicted because 5.9 has awith: php-version: '7.4'block immediately after theif:) andjshintjob..github/workflows/javascript-tests.yml–test-jsjob (conflicted because 5.9 has awith: disable-apparmor: trueblock after theif:)..github/workflows/php-compatibility.yml–php-compatibilityjob (conflicted because 5.9 has awith: php-version: '7.4'block after theif:)..github/workflows/phpunit-tests.yml–test-phpjob. This file conflicted heavily: 5.9 has a singletest-phpjob withsecrets: inherit, whiletrunkhasprepare-gutenberg,test-with-mysql,test-with-mariadb,test-innovation-releases,html-api-test-groups, andlimited-matrix-for-forks. Only the existingtest-phpjob was updated. None of thetrunk-only jobs were added, so thestartsWith( github.repository, 'WordPress/' ) && (...)variant and the fork-onlylimited-matrix-for-forksvariant of the condition do not appear on this branch — 5.9'stest-phpuses the plaingithub.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request'form and therefore received the plain replacement condition.Intentionally left untouched
slack-notificationsandfailed-workflowjobs — they are gated ongithub.event_name != 'pull_request'and are unaffected..github/workflows/test-build-processes.yml– thetest-core-build-process-macosjob is gated only ongithub.repository == 'WordPress/wordpress-develop', which is not part of the condition family this commit changes..github/workflows/welcome-new-contributors.yml— not touched by the original commit.Net result
6 files changed, all under
.github/workflows/. Seven jobif:gates updated in total. All 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.