Backport: Skip pull_request triggered runs in private repos - 6.0 Branch - #12997
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 6.0 Branch#12997desrosj 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.0 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The 6.0 branch has a much smaller set of workflow files and older job definitions, so the following adaptations were made.
Files from the original commit that do not exist on the 6.0 branch (dropped entirely,
git rm'd after the cherry-pick left them in the tree):.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(no equivalentupgrade-testing.ymlexists on 6.0 either).github/workflows/workflow-lint.ymlBecause
upgrade-develop-testing.ymlandworkflow-lint.ymldo not exist on this branch, theuses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk→uses: ./.github/workflows/<x>.ymlportion of the original commit was not carried over. The 6.0 branch also has noreusable-*.ymlworkflow files of its own, so localuses:references would not resolve.Files that applied cleanly (no conflict):
.github/workflows/end-to-end-tests.yml—e2e-testsjob..github/workflows/test-build-processes.yml—test-core-build-processjob.Conflicts resolved by hand:
.github/workflows/coding-standards.yml— thephpcsjob conflicted because 6.0 has awith: php-version: '7.4'block immediately after theif:, which trunk no longer has. Resolution: took the new multi-lineif:condition from the commit and kept 6.0'swith:block after it. Thejshintjob in the same file merged cleanly..github/workflows/javascript-tests.yml— thetest-jsjob conflicted for the same reason (6.0 haswith: disable-apparmor: trueafter theif:). Resolution: newif:condition followed by 6.0's existingwith:block..github/workflows/php-compatibility.yml— thephp-compatibilityjob conflicted for the same reason (with: php-version: '7.4'). Resolution: newif:condition followed by 6.0's existingwith:block..github/workflows/phpunit-tests.yml— three conflict hunks:prepare-gutenbergjob (and itsjobs:key). That job does not exist on 6.0 and the reusable workflow it calls is not applicable here, so the hunk was dropped.test-phpjob conflicted: 6.0 usessecrets: inherit(trunk lists individual secrets) and 6.0's condition is the plaingithub.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request'form without trunk'sstartsWith( github.repository, 'WordPress/' ) && ( ... )wrapper. Resolution: kept 6.0'ssecrets: inherit, and applied the canonical replacement condition without thestartsWith( ... )wrapper, since that wrapper is not part of the 6.0 gate and adding it would change which repos run the job.test-with-mariadb, the SQLite/fork jobs, Gutenberg artifact inputs, etc.) into 6.0. Dropped entirely; 6.0'stest-phpjob body is unchanged.Intentionally not touched:
slack-notificationsjobs (gated ongithub.event_name != 'pull_request') and allfailed-workflowjobs..github/workflows/test-build-processes.yml→test-core-build-process-macos, which is gated only ongithub.repository == 'WordPress/wordpress-develop'and is not part of the|| github.event_name == 'pull_request'family..github/workflows/welcome-new-contributors.yml, which the original commit did not touch.Verification performed: the diff against
6.0touches only files under.github/workflows/; no conflict markers remain; all six changed YAML files parse with PyYAML and expose the expected job keys.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.