Backport: Skip pull_request triggered runs in private repos - 5.2 Branch - #12983
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 5.2 Branch#12983desrosj 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.2 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The
5.2branch only contains four workflow files (coding-standards.yml,javascript-tests.yml,phpunit-tests.yml,test-build-processes.yml), while the original commit touched twelve. Details of what was applied, dropped, and hand-adapted:Jobs the condition was applied to (5 total)
.github/workflows/coding-standards.ymlphpcs.github/workflows/coding-standards.ymljshint.github/workflows/javascript-tests.ymltest-js.github/workflows/phpunit-tests.ymltest-php.github/workflows/test-build-processes.ymltest-core-build-processAll five previously used the identical gate
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}and were replaced with the canonical multi-line form from the source commit. NostartsWith( github.repository, 'WordPress/' )variants, nogithub.event.beforeclause, and no fork-only (! startsWith(...)) jobs exist on this branch, so none of the other shapes from the original commit were needed.Files dropped (do not exist on the
5.2branch)These came through the cherry-pick as
modify/deleteconflicts and were removed withgit rmso they are not newly created on this branch:.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(noupgrade-testing.ymlequivalent exists on this branch either).github/workflows/workflow-lint.ymlConflict resolution per file
coding-standards.yml— content conflict on thephpcsjob only, because on this branch theif:is followed by awith:block (php-version: '7.3',old-branch: true) that does not exist on trunk. Resolved by taking the new multi-lineif:and preserving this branch'swith:block beneath it. Thejshintjob merged cleanly.javascript-tests.yml— same shape of conflict ontest-js, whoseif:is followed bywith: disable-apparmor: trueon this branch. Resolved by taking the newif:and preserving thewith:block.phpunit-tests.yml— the largest divergence. Trunk hasprepare-gutenberg,test-with-mysql,test-with-mariadb,test-with-sqlite, and a fork-only job;5.2has a singletest-phpjob usingreusable-phpunit-tests-v2.yml. The conflict attempted to import those trunk-only jobs wholesale. The file was restored to theupstream/5.2version and the newif:was hand-applied totest-phponly (the sole job on this branch matching the gate family). No trunk-only jobs were introduced.test-build-processes.yml— auto-merged cleanly ontotest-core-build-process; verified the condition landed on the correct job.Intentionally left untouched
slack-notificationsandfailed-workflowjobs in the four files — gated ongithub.event_name != 'pull_request'and unaffected.test-build-processes.yml→test-core-build-process-macos, gated onif: ${{ github.repository == 'WordPress/wordpress-develop' }}only. It never runs for forkpull_requestevents, so it is not part of the gate family the commit targets.uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk→uses: ./.github/workflows/<x>.ymlportion of the original commit was skipped: it applied only toupgrade-develop-testing.ymlandworkflow-lint.yml, neither of which exists on this branch, and this branch has no localreusable-*.ymlfiles to reference.Verification
git diff upstream/5.2 --statshows only the four files above (40 insertions, 5 deletions)..github.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.