Backport: Skip pull_request triggered runs in private repos - 6.8 Branch - #12992
Draft
desrosj wants to merge 2 commits into
Draft
Backport: Skip pull_request triggered runs in private repos - 6.8 Branch#12992desrosj 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.8 branch.
Merge Conflict Resolution
The cherry-pick conflicted in every file it touched. The
if:gate on the 6.8 branch carries anextra
github.actor != 'dependabot[bot]'clause that no longer exists ontrunk, so no hunk appliedcleanly. Additionally,
phpunit-tests.ymlon 6.8 differs substantially fromtrunk(noprepare-gutenbergjob,secrets: inheritinstead of explicit secrets, nostartsWith( github.repository, 'WordPress/' )gating, no fork-only job), which made that file'sconflicts unusable.
Rather than hand-editing conflict hunks that contained unrelated
trunk-only content, everyconflicted file was reset to its 6.8 content and the condition change was applied by hand to each
qualifying job.
Adapted condition shape
Because 6.8 gates on dependabot as well, the standard replacement used here preserves that clause:
Jobs updated by hand (14 total)
.github/workflows/coding-standards.ymlphpcs,jshint.github/workflows/end-to-end-tests.ymle2e-tests.github/workflows/javascript-tests.ymltest-js.github/workflows/performance.ymldetermine-matrix.github/workflows/php-compatibility.ymlphp-compatibility.github/workflows/phpunit-tests.ymltest-with-mysql,test-with-mariadb,test-innovation-releases,specific-test-groups.github/workflows/test-build-processes.ymltest-core-build-process,test-gutenberg-build-process.github/workflows/upgrade-develop-testing.ymlupgrade-tests-develop.github/workflows/workflow-lint.ymllintperformance.yml'sdetermine-matrixjob additionally keeps its&& ! contains( github.event.before, '00000000' )clause, matching the shape used ontrunk:Hunks dropped
.github/workflows/javascript-type-checking.yml— does not exist on 6.8. The cherry-pick left thetrunkversion of the whole file in the tree; it wasgit rm'd rather than created..github/workflows/phpstan-static-analysis.yml— does not exist on 6.8. Same handling as above..github/workflows/test-and-zip-default-themes.yml— does not exist on 6.8. Same handling as above.phpunit-tests.yml: theprepare-gutenbergjob, thegutenberg-artifact/gutenberg-shainputs,the explicit
CODECOV_TOKEN/WPT_REPORT_API_KEYsecrets blocks, thestartsWith( github.repository, 'WordPress/' ) && ( ... )outer wrapper, and the fork-onlytest-with-mysqlvariant job all came along with the conflict but do not exist on 6.8. None wereintroduced. Only the
if:lines on the four existing jobs were changed.uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk→uses: ./.github/workflows/<x>.ymlchange from the original commit was not carried over forupgrade-develop-testing.ymlorworkflow-lint.yml. The 6.8 branch contains noreusable-*.ymlworkflow files at all, so the local references would not resolve.
upgrade-develop-testing.yml: the original commit also updated thebuildjob and theupgrade-tests-develop-forksjob. Neither has anif:gate (thebuildjob) or exists at all(
upgrade-tests-develop-forks) on 6.8, so those hunks were dropped.Deliberately left untouched
.github/workflows/upgrade-testing.yml— exists on bothtrunkand 6.8 and was not touched by theoriginal commit. Note that its jobs on 6.8 do carry the
|| ( pull_request && ! dependabot )family gate (on
trunkthey are gated ongithub.repository == 'WordPress/wordpress-develop'only). Flagging this in case it should be included; it was left alone to match the scope of r63183.
.github/workflows/local-docker-environment.yml— same situation: has the family gate on 6.8, butthe original commit did not touch this workflow on
trunk.github.event_name != 'pull_request', unaffected).props-bot.yml,pull-request-comments.yml,cleanup-pull-requests.yml,check-built-files.yml.Verification
git diff upstream/6.8 --statshows only files under.github/workflows/(9 files, +129/-14).git grep -n -E '^(<<<<<<<|=======|>>>>>>>)' -- .githubreturns nothing.if:expressions werere-serialized and inspected to confirm the boolean grouping is correct.
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.