Backport: Skip pull_request triggered runs in private repos - 5.6 Branch - #12982
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 5.6 Branch#12982desrosj 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.6 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The
5.6branch only contains 5 workflow files, so most of the original commit did not apply.Files updated (6 jobs total, all with the standard replacement condition):
.github/workflows/coding-standards.yml—phpcsandjshintjobs. Thephpcsjob conflicted because on5.6it is followed by awith: php-version: '7.4'block that does not exist ontrunk; resolved by taking the newif:and keeping the existingwith:block. Thejshintjob merged cleanly..github/workflows/javascript-tests.yml—test-jsjob. Conflicted for the same reason (5.6has awith: disable-apparmor: trueblock after theif:); resolved by taking the newif:and keepingwith:..github/workflows/php-compatibility.yml—php-compatibilityjob. Same conflict shape (with: php-version: '7.4'); resolved the same way..github/workflows/phpunit-tests.yml—test-phpjob. The incoming diff tried to pull in trunk-only jobs (prepare-gutenberg,test-with-mysql,test-with-mariadb, the fork-only job, etc.) that do not exist on5.6. The file was reset to the5.6version and the condition was applied by hand to the single gated job,test-php, preserving the branch'ssecrets: inheritline..github/workflows/test-build-processes.yml—test-core-build-processjob. Merged cleanly.Hunks dropped because the file does not exist on
5.6:.github/workflows/end-to-end-tests.yml.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.ymlon this branch either).github/workflows/workflow-lint.ymlEach of these was left in the tree by the cherry-pick as a modify/delete conflict and was removed with
git rm, since creating them on5.6is out of scope.Other pieces intentionally not carried over:
uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk→uses: ./.github/workflows/<x>.ymlchange from the original commit applied only toupgrade-develop-testing.ymlandworkflow-lint.yml, neither of which exists on5.6. No reusable workflow files exist in this branch's.github/workflows/directory, so nothing was converted to a local path.startsWith( github.repository, 'WordPress/' ) && (...)wrapper, the! contains( github.event.before, '00000000' )clause, the fork-only job variant, and the push-event variant) have no counterpart on5.6; every gated job on this branch uses the plaingithub.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request'form.test-build-processes.yml'stest-core-build-process-macosjob is gated only ongithub.repository == 'WordPress/wordpress-develop'and is not part of the affected family, so it was left alone (matching the original commit, which only touched one job in that file).failed-workflowjobs are gated ongithub.event_name != 'pull_request'and were not touched.Verification: the diff against
5.6touches only files under.github/workflows/, contains no conflict markers, and all 5 changed YAML files parse successfully.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.