Backport: Skip pull_request triggered runs in private repos - 6.4 Branch - #12993
Draft
desrosj wants to merge 2 commits into
Draft
Backport: Skip pull_request triggered runs in private repos - 6.4 Branch#12993desrosj 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.4 branch.
Merge Conflict Resolution
The cherry-pick conflicted. The 6.4 branch has a much smaller and older set of workflow files than
trunk, so a number of hunks were dropped and two files were adapted by hand. Details:Files from the original commit that do not exist on 6.4 (hunks dropped entirely)
These came through as
modify/deleteconflicts and weregit rm'd so they are not created on this 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.ymlBecause
upgrade-develop-testing.ymlandworkflow-lint.ymldo not exist on 6.4, the part of the original commit that switched those two workflows fromuses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunktouses: ./.github/workflows/<x>.ymlwas not carried over. The referenced reusable workflows (reusable-build-package.yml,reusable-upgrade-testing.yml,reusable-workflow-lint.yml) also do not exist on 6.4.Applied cleanly (auto-merged, one job each unless noted)
.github/workflows/coding-standards.yml—phpcsandjshint(2 jobs)..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-process. Thetest-core-build-process-macosjob is gated only ongithub.repository == 'WordPress/wordpress-develop'and was left alone..github/workflows/phpunit-tests.yml(content conflict, hand-resolved)The 6.4 version of this workflow only contains two jobs from the family (
test-with-mysqlandtest-with-mariadb), and neither is wrapped in thestartsWith( github.repository, 'WordPress/' ) && ( ... )guard thattrunkuses. Resolution:startsWith) form of the new condition totest-with-mysqlandtest-with-mariadb.secrets: inheritrather than importing trunk's explicitCODECOV_TOKEN/WPT_REPORT_API_KEYsecret list.report: ${{ matrix.report || false }}input.prepare-gutenberg,test-innovation-releases,html-api-test-groups, andlimited-matrix-for-forksjobs entirely — none of them exist on 6.4 and they were only pulled in as conflict context. This also means the fork-onlylimited-matrix-for-forksvariant of the condition is not present on this branch..github/workflows/upgrade-testing.yml(hand-applied, judgment call — please confirm)trunk'supgrade-develop-testing.ymlhas no direct counterpart on 6.4. 6.4'supgrade-testing.ymlis the ancestor oftrunk'supgrade-testing.yml, which the original commit did not touch — ontrunkthose jobs are already gated ongithub.repository == 'WordPress/wordpress-develop'alone, so there was nothing there to change. On 6.4 they still carry the old... || github.event_name == 'pull_request'gate, so the new condition was applied by hand to all five upgrade test jobs to match the intent of the commit:upgrade-tests-wp-6x-mysqlupgrade-tests-wp-5x-php-7x-mysqlupgrade-tests-wp-5x-php-8x-mysqlupgrade-tests-wp-4x-php-7x-mysqlupgrade-tests-wp-4x-php-8x-mysqlIf this is considered out of scope for the backport, this file can be reverted independently without affecting the rest of the change.
Left untouched
slack-notificationsandfailed-workflowjobs (gated ongithub.event_name != 'pull_request')..github/workflows/upgrade-testing-run.yml(reusable workflow, no gates of this family)..github/workflows/welcome-new-contributors.yml.Verification performed
git diff upstream/6.4 --statshows changes only under.github/workflows/(7 files, +104/-13).git grep -E '^(<<<<<<<|=======|>>>>>>>)' -- .githubreturns nothing).github.event_name == 'pull_request' }}gate remain in.github/workflows/.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.