Backport: Skip pull_request triggered runs in private repos - 7.0 Branch - #12988
Draft
desrosj wants to merge 1 commit into
Draft
Backport: Skip pull_request triggered runs in private repos - 7.0 Branch#12988desrosj 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 7.0 branch.
Merge Conflict Resolution
The cherry-pick did not apply cleanly. The following adaptations were made for the
7.0branch:.github/workflows/test-and-zip-default-themes.yml— dropped entirelyThis file does not exist on the
7.0branch (it was introduced ontrunkin [b71a7bf], after 7.0 was branched), so the cherry-pick reported amodify/deleteconflict. The file wasgit rm'd rather than created, since introducing a brand new workflow is out of scope for a backport. The two hunks from the original commit that targeted itstest-default-themesandzip-default-themesjobs were dropped..github/workflows/phpunit-tests.yml— 5 content conflicts, all resolved the same wayAll five conflicts were caused by unrelated drift between
trunkand7.0in the lines immediately adjacent to theif:gates:trunkpasses secrets explicitly, while7.0still usessecrets: inherit.In every case the branch's
secrets: inheritline was kept unchanged and only the newif:condition from r63183 was taken. The affected jobs are:test-with-mysqltest-with-mariadbtest-innovation-releaseshtml-api-test-groups(the four above all use the
startsWith( github.repository, 'WordPress/' ) && ( ... )outer wrapper)limited-matrix-for-forks, the fork-only job gated on! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request', which received the private/draft/label group appended directly, per the original commit.The
prepare-gutenbergjob applied cleanly.uses:changes reverted — reusable workflows do not live on this branchThe original commit also switched two workflows from
uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunkto a localuses: ./.github/workflows/<x>.ymlreference. The7.0branch contains noreusable-*.ymlfiles at all (verified withgit ls-tree -r --name-only 7.0 .github/workflows/ | grep reusable→ 0 results); every workflow on this branch consumes the reusable workflows fromtrunkin the canonical repo.Applying the local references would therefore break these workflows, so the
uses:lines were restored to their7.0values after the cherry-pick, and only theif:conditions were backported:.github/workflows/upgrade-develop-testing.yml—buildjob keptuses: WordPress/wordpress-develop/.github/workflows/reusable-build-package.yml@trunk;upgrade-tests-develop-forksjob keptuses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk..github/workflows/workflow-lint.yml—lintjob keptuses: WordPress/wordpress-develop/.github/workflows/reusable-workflow-lint.yml@trunk.The
if:changes for those three jobs (including the# This job also runs for the push event, which has no draft state to check.comment onupgrade-tests-develop-forks) were applied in full.Applied cleanly, no adaptation needed
coding-standards.yml(2 jobs),end-to-end-tests.yml,javascript-tests.yml,javascript-type-checking.yml,performance.yml(determine-matrix, including the! contains( github.event.before, '00000000' )clause),php-compatibility.yml,phpstan-static-analysis.yml,test-build-processes.yml.Verification
git diff 7.0 --stattouches only files under.github/workflows/(11 files).github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request'style gate in the touched files returns nothing. Slack notification jobs (gated ongithub.event_name != 'pull_request') and untouched workflows (props-bot.yml,pull-request-comments.yml,check-built-files.yml,cleanup-pull-requests.yml,local-docker-environment.yml) were left alone.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.