Skip to content

Backport: Skip pull_request triggered runs in private repos - 5.4 Branch - #12979

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

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

Conversation

@desrosj

@desrosj desrosj commented Aug 12, 2026

Copy link
Copy Markdown
Member

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

Merge Conflict Resolution

The cherry-pick conflicted. The 5.4 branch has only 4 workflow files, so most of the original commit does not apply here.

Files updated (5 jobs total):

  • .github/workflows/coding-standards.ymlphpcs and jshint jobs.
  • .github/workflows/javascript-tests.ymltest-js job.
  • .github/workflows/phpunit-tests.ymltest-php job.
  • .github/workflows/test-build-processes.ymltest-core-build-process job.

All five received the canonical replacement condition verbatim:

    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' )
        )
      )

Hunks dropped because the file does not exist on the 5.4 branch (these came through the cherry-pick as modify/delete conflicts and were git rm'd):

  • .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

Content conflicts and how they were resolved:

  • coding-standards.yml, javascript-tests.yml, phpunit-tests.yml all conflicted textually. In each case the conflict was caused by trailing context that differs on 5.4 (with: php-version: '7.3', with: disable-apparmor: true, and secrets: inherit respectively) sitting directly adjacent to the if: line. These three files were reset to their 5.4 state and the condition was applied by hand so no unrelated trunk-only context leaked in.
  • phpunit-tests.yml on 5.4 has a single test-php job that calls reusable-phpunit-tests-v2.yml. Trunk's prepare-gutenberg, test-with-mysql, test-with-mariadb, test-with-sqlite, test-old-branches, and the fork-only test-with-mysql-forks jobs do not exist here, so the startsWith( github.repository, 'WordPress/' ) && (...) and ! startsWith( ... ) variants from the original commit have no target on this branch and were dropped.
  • test-build-processes.yml auto-merged cleanly for test-core-build-process. Its test-core-build-process-macos job is gated only on github.repository == 'WordPress/wordpress-develop' (no pull_request clause), so it is not part of the affected family and was deliberately left alone.

Not carried over:

  • The uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunkuses: ./.github/workflows/<x>.yml change from upgrade-develop-testing.yml and workflow-lint.yml: neither file exists on 5.4.
  • Slack notification jobs (slack-notifications) and failed-workflow jobs across all four files: gated on github.event_name != 'pull_request', unaffected by this change.

Nothing outside .github/workflows/ was touched. All four changed files were verified to parse as valid YAML and contain no conflict markers.

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