Skip to content

Backport: Skip pull_request triggered runs in private repos - 4.9 Branch - #12998

Draft
desrosj wants to merge 1 commit into
WordPress:4.9from
desrosj:backport/4.9-branch-63183
Draft

Backport: Skip pull_request triggered runs in private repos - 4.9 Branch#12998
desrosj wants to merge 1 commit into
WordPress:4.9from
desrosj:backport/4.9-branch-63183

Conversation

@desrosj

@desrosj desrosj commented Aug 12, 2026

Copy link
Copy Markdown
Member

This backports 15c4b04 (r63183) to the 4.9 branch.

Merge Conflict Resolution

git cherry-pick produced conflicts on every touched file (4 content conflicts plus 8 modify/delete conflicts), so the cherry-pick was aborted and the change was applied by hand with the original commit message instead.

The 4.9 branch only has 4 workflow files under .github/workflows/ (coding-standards.yml, javascript-tests.yml, phpunit-tests.yml, test-build-processes.yml). Each contains exactly one job whose if: gate matches the github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' pattern from the original commit, and each was updated to the canonical replacement condition:

    if: |
      github.repository == 'WordPress/wordpress-develop' || (
        github.event_name == 'pull_request' && (
          ! github.event.repository.private ||
          ! github.event.pull_request.draft ||
          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
        )
      )
  • .github/workflows/coding-standards.ymljshint job.
  • .github/workflows/javascript-tests.ymltest-js job.
  • .github/workflows/phpunit-tests.ymltest-php job. (This branch has only a single PHP-matrix job here, unlike trunk's multiple PHP/MySQL jobs gated with the startsWith( github.repository, 'WordPress/' ) variant, so only the simple form was needed.)
  • .github/workflows/test-build-processes.ymltest-core-build-process job. (The test-core-build-process-macos job on this branch is gated only on github.repository == 'WordPress/wordpress-develop', with no pull_request clause, so it was left untouched — it is not an equivalent of any job the original commit touched.)

The following files from the original commit do not exist on the 4.9 branch, so their hunks were dropped entirely (nothing to do, nothing created):

  • .github/workflows/end-to-end-tests.yml
  • .github/workflows/javascript-type-checking.yml
  • .github/workflows/performance.yml
  • .github/workflows/php-compatibility.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.yml

No uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunkuses: ./.github/workflows/<x>.yml conversions were carried over: upgrade-develop-testing.yml and workflow-lint.yml do not exist on this branch.

Slack-notification and failed-workflow jobs were left untouched, as they are gated on github.event_name != 'pull_request' and are unaffected by this change.

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.

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
@desrosj desrosj self-assigned this Aug 12, 2026
@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant