Backport: Skip pull_request triggered runs in private repos - 6.3 Branch - #12990
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 6.3 Branch#12990desrosj 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 6.3 branch.
Merge Conflict Resolution
The cherry-pick conflicted because the 6.3 branch has a much smaller and older set of workflow files than
trunk. All resolutions were confined to.github/workflows/.Jobs updated (7 jobs across 6 files)
The canonical replacement condition was applied to every job on this branch whose gate was
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}:coding-standards.yml→phpcs,jshintend-to-end-tests.yml→e2e-testsjavascript-tests.yml→test-jsphp-compatibility.yml→php-compatibilityphpunit-tests.yml→test-phptest-build-processes.yml→test-core-build-processNone of these jobs exist on 6.3 in the
startsWith( github.repository, 'WordPress/' ) && ( ... )wrapped form used ontrunk, so the plain (unwrapped) canonical condition was used for all of them.Conflicts and how they were resolved
coding-standards.yml(phpcs) andphp-compatibility.yml(php-compatibility) — content conflicts. On 6.3 these jobs have awith: php-version: '7.4'block immediately after theif:key, whichtrunkno longer has. Resolved by taking the new multi-lineif:from the cherry-pick and re-appending the branch's existingwith: php-version: '7.4'block below it. No other changes to these jobs.phpunit-tests.yml— content conflict. The incoming change wanted to add theprepare-gutenbergjob and rewritetest-phpto usesecrets: CODECOV_TOKEN/WPT_REPORT_API_KEY, plus pull in thetest-with-mariadb/test-with-sqlite/ fork-specific jobs, none of which exist on 6.3. Resolved by restoring the branch's version of the file in full and hand-applying only the newif:condition to the singletest-phpjob. The branch'ssecrets: inheritline and the rest of the job were left untouched. No new jobs were introduced.end-to-end-tests.yml,javascript-tests.yml,test-build-processes.yml— auto-merged cleanly; no manual intervention.Hunks dropped (file does not exist on 6.3)
These files from the original commit do not exist on this branch, so their hunks were dropped and the files were
git rm'd from the cherry-pick so they are not created here:javascript-type-checking.ymlperformance.ymlphpstan-static-analysis.ymltest-and-zip-default-themes.ymlupgrade-develop-testing.yml(no equivalentupgrade-testing.ymlexists on 6.3 either)workflow-lint.ymlOther pieces of the original commit intentionally not carried over
uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk→uses: ./.github/workflows/<x>.ymlswitch applied only toupgrade-develop-testing.ymlandworkflow-lint.yml, neither of which exists on 6.3. Skipped.test-build-processes.yml→test-core-build-process-macoswas not changed. It is gated onif: ${{ github.repository == 'WordPress/wordpress-develop' }}only, which is not part of the condition family this commit modifies (it already never runs in forks or mirrors), and the equivalent job was not touched by the original commit.slack-notificationsandfailed-workflowjobs in all six files were left untouched, as they are gated ongithub.event_name != 'pull_request'and are unaffected.welcome-new-contributors.ymlwas not touched.Verification performed
git diff upstream/6.3 --statshows only the six files above (56 insertions, 7 deletions)..github.if:expression was dumped and inspected to confirm correct structure and indentation.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.