Backport: Skip pull_request triggered runs in private repos - 6.1 Branch - #12981
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 6.1 Branch#12981desrosj 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.1 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The 6.1 branch has only 6 workflow files in the affected family (plus
welcome-new-contributors.yml, which is out of scope), so a majority of the original commit's hunks do not apply here.Files updated (7 jobs across 6 files)
All received the canonical replacement condition:
.github/workflows/coding-standards.yml—phpcsandjshintjobs.github/workflows/end-to-end-tests.yml—e2e-testsjob.github/workflows/javascript-tests.yml—test-jsjob.github/workflows/php-compatibility.yml—php-compatibilityjob.github/workflows/phpunit-tests.yml—test-phpjob.github/workflows/test-build-processes.yml—test-core-build-processjobConflicts and how they were resolved
coding-standards.yml(content conflict) — On 6.1 thephpcsjob has an extrawith: php-version: '7.4'block immediately following theif:line, which trunk does not have. Resolved by taking the new multi-lineif:condition and preserving the existingwith:block after it. Thejshintjob auto-merged cleanly.php-compatibility.yml(content conflict) — Same cause and same resolution: 6.1'sphp-compatibilityjob carries awith: php-version: '7.4'block after theif:line. New condition applied,with:block preserved.phpunit-tests.yml(content conflict) — This file has diverged substantially between 6.1 and trunk. The cherry-pick attempted to introduce trunk-only content that does not belong on this branch: aprepare-gutenbergjob, thetest-with-mariadb/ fork-specific test jobs,secrets:blocks listingCODECOV_TOKEN/WPT_REPORT_API_KEY(6.1 usessecrets: inherit), andgutenberg-artifact/gutenberg-shainputs. Rather than untangle the merge, the file was reset to the 6.1 version (git checkout upstream/6.1 -- .github/workflows/phpunit-tests.yml) and the condition was hand-applied to the singletest-phpjob. 6.1 has none of thestartsWith( github.repository, 'WordPress/' )job variants nor the fork-only job from trunk, so only the plain canonical form was needed.end-to-end-tests.yml,javascript-tests.yml,test-build-processes.yml— auto-merged cleanly, no manual intervention.Hunks dropped (files do not exist on 6.1)
These files were reported as modify/delete conflicts and were
git rm'd, since they do not exist on this branch and no equivalent file exists either:.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(noupgrade-testing.ymlequivalent on 6.1 either).github/workflows/workflow-lint.ymlBecause
upgrade-develop-testing.ymlandworkflow-lint.ymldo not exist here, the accompanyinguses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk→uses: ./.github/workflows/<x>.ymlchange from the original commit was not carried over. 6.1 also has no localreusable-*.ymlworkflow files, so that change would not have been valid on this branch regardless.Intentionally left alone
github.event_name != 'pull_request'and unaffected.test-build-processes.ymltest-build-scriptsjob (if: ${{ github.repository == 'WordPress/wordpress-develop' }}) — not part of the targeted condition family.welcome-new-contributors.yml— out of scope.Verification
git diff upstream/6.1 --statshows only files under.github/workflows/.|| github.event_name == 'pull_request'form remain in.github/workflows/.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.