Backport: Skip pull_request triggered runs in private repos - 6.5 Branch - #12995
Draft
desrosj wants to merge 2 commits into
Draft
Backport: Skip pull_request triggered runs in private repos - 6.5 Branch#12995desrosj 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.5 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The 6.5 branch has a much smaller and older set of workflow files than
trunk, so several hunks had no destination and a few jobs needed the condition applied by hand. Details below.Applied cleanly (auto-merged by the cherry-pick)
The canonical replacement was applied verbatim to these jobs:
.github/workflows/coding-standards.yml—phpcs,jshint.github/workflows/end-to-end-tests.yml—e2e-tests.github/workflows/javascript-tests.yml—test-js.github/workflows/php-compatibility.yml—php-compatibility.github/workflows/test-build-processes.yml—test-core-build-processHunks dropped — file does not exist on the 6.5 branch
These files were modified by r63183 but do not exist on 6.5. The cherry-pick left them as modify/delete conflicts; they were
git rm'd so that no new files are introduced by this backport:.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.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 r63183 was not carried over. The 6.5 branch also has noreusable-*.ymlworkflow files at all, so a local./reference would not resolve. Alluses:lines in this branch are left pointing at@trunk, unchanged.Hand-applied — content conflict
.github/workflows/phpunit-tests.ymlconflicted heavily. The trunk version of this file has since grown aprepare-gutenbergjob,test-innovation-releases,html-api-test-groups, andlimited-matrix-for-forks, plusstartsWith( github.repository, 'WordPress/' ) && (...)wrappers and explicitsecrets:blocks — none of which exist on 6.5. The file was reset to the 6.5 version and the canonical condition was applied by hand to the only two jobs that carry the gate:test-with-mysqltest-with-mariadbThe
startsWith( github.repository, 'WordPress/' ) && ( ... )outer wrapper from trunk was intentionally not introduced, since 6.5 never had it and adding it would change which repositories run these jobs (a behavior change unrelated to this backport). The fork-onlylimited-matrix-for-forksjob that r63183 also updated does not exist on 6.5, so that hunk was dropped.Hand-applied — jobs with the same gate that r63183 did not touch textually
Per the intent of r63183 (no
pull_requestruns in private mirrors while a PR is in draft), the same condition was applied to the remaining jobs in the touched/equivalent workflow files that still carry thegithub.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request'gate:.github/workflows/test-build-processes.yml—test-gutenberg-build-process. This job was removed fromtrunksome time ago, so r63183 had no corresponding hunk, but it lives in a file the commit touched and carries the exact gate..github/workflows/upgrade-testing.yml—upgrade-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-mysql.Please review this file specifically.
upgrade-testing.ymlon 6.5 is the ancestor oftrunk'supgrade-testing.yml(upgrades from released WordPress.org versions), not ofupgrade-develop-testing.yml(which was introduced later as a new file, not a rename). Ontrunk,upgrade-testing.ymlwas not touched by r63183 because its gates have since been narrowed togithub.repository == 'WordPress/wordpress-develop'alone. On 6.5 those jobs still carry the|| github.event_name == 'pull_request'gate and do run for pull requests, so the condition was applied here to match the intent of the commit. If reviewers would rather leave this file untouched, dropping theupgrade-testing.ymlhunks is safe and independent of the rest of the diff.Explicitly left alone
failed-workflowjobs in every file — gated ongithub.event_name != 'pull_request', unaffected..github/workflows/test-build-processes.yml—test-core-build-process-macos,test-gutenberg-build-process-macos(github.repository == 'WordPress/wordpress-develop'only) andplayground-comment(github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request'). None are in the affected condition family; all are already restricted to the canonical public repo..github/workflows/props-bot.ymland.github/workflows/pull-request-comments.yml— not touched by r63183 and not equivalents of anything it touched.Verification
git diff 6.5 --stattouches only files under.github/workflows/; no files added or removed.git grep -E '^(<<<<<<<|=======|>>>>>>>)' -- .githubreturns nothing).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.