Backport: Skip pull_request triggered runs in private repos - 6.7 Branch - #12991
Draft
desrosj wants to merge 2 commits into
Draft
Backport: Skip pull_request triggered runs in private repos - 6.7 Branch#12991desrosj wants to merge 2 commits into
desrosj wants to merge 2 commits 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.7 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The 6.7 branch has a much smaller and differently shaped set of workflow files than
trunk, so most of the commit had to be adapted by hand. Details below.Files updated (14 job gates in total)
.github/workflows/coding-standards.ymlphpcs,jshint.github/workflows/end-to-end-tests.ymle2e-tests.github/workflows/javascript-tests.ymltest-js.github/workflows/php-compatibility.ymlphp-compatibility.github/workflows/phpunit-tests.ymltest-with-mysql,test-with-mariadb.github/workflows/test-build-processes.ymltest-core-build-process,test-gutenberg-build-process.github/workflows/upgrade-testing.ymlupgrade-tests-wp-6x-mysql,upgrade-tests-wp-5x-php-7x-mysql,upgrade-tests-wp-5x-php-8x-mysql,upgrade-tests-wp-4x-php-7x-mysql,upgrade-tests-wp-4x-php-8x-mysqlEvery one of these was previously gated with the plain
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}and now uses the canonical replacement:coding-standards.yml,end-to-end-tests.yml,javascript-tests.yml, andphp-compatibility.ymlmerged cleanly with no manual intervention.Hunks dropped — files that do not exist on 6.7
The cherry-pick reported
modify/deleteconflicts for six workflow files that exist ontrunkbut not on 6.7. All six weregit rm'd so that this backport does not introduce brand new workflows to a security-only 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.ymlManual adaptations
phpunit-tests.yml— content conflict. Thetrunkversion of this workflow has diverged substantially (aprepare-gutenbergjob, per-secretsecrets:blocks,startsWith( github.repository, 'WordPress/' ) && (...)wrappers, atest-innovation-releasesjob, and a separate fork-only job). None of that exists on 6.7. Resolution:prepare-gutenbergjob entirely — it does not exist on this branch.test-innovation-releasesjob and the fork-only PHPUnit job — neither exists on this branch.secrets: inheritrather than takingtrunk's explicitCODECOV_TOKEN/WPT_REPORT_API_KEYblock.with:inputs (report: ${{ matrix.report || false }}) rather thantrunk'sgutenberg-artifact/gutenberg-shainputs.test-with-mysqlandtest-with-mariadbjobs are not wrapped instartsWith( github.repository, 'WordPress/' ) && (...), the plain canonical form was applied to both rather than thestartsWith()variant used ontrunk. This preserves the existing behavior on this branch and only adds the private/draft/label narrowing.test-build-processes.yml— thetest-core-build-processjob merged cleanly. Thetest-gutenberg-build-processjob was updated by hand: that job no longer exists ontrunk, so there was no corresponding hunk in the source commit, but its gate is of the same family and it runs onpull_request. The two macOS jobs (test-core-build-process-macos,test-gutenberg-build-process-macos) were left alone — they are gatedgithub.repository == 'WordPress/wordpress-develop'only and never run on forks.upgrade-testing.yml— all five gates applied by hand; there was no corresponding hunk in the source commit. Worth a careful look from a reviewer: ontrunk, the touched workflow isupgrade-develop-testing.yml(added later in 24a2eac and never backported), whiletrunk's ownupgrade-testing.ymlwas left untouched by r63183 because its jobs have since been narrowed togithub.repository == 'WordPress/wordpress-develop'only. On 6.7 that narrowing never happened, so all five jobs still carry the|| github.event_name == 'pull_request'gate and do fire forpull_requestevents (the workflow has apull_requesttrigger with apathsfilter on the workflow files themselves). Applying the change here is what preserves the intent of r63183 on this branch. If the preference is instead to leave this file untouched, that hunk can be dropped independently of the rest.Not touched
slack-notificationsandfailed-workflowjobs — gated ongithub.event_name != 'pull_request'and unaffected.props-bot.ymlandpull-request-comments.yml— not touched by the source commit and not equivalents of anything it touched.upgrade-develop-testing.ymlandworkflow-lint.ymlfromuses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunktouses: ./.github/workflows/<x>.yml. Neither file exists on 6.7, so that part was skipped entirely. No otheruses:line was changed.Verification
git diff 6.7 --statshows changes only under.github/workflows/(7 files, +112/-14)..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.