Skip to content

Backport: Skip pull_request triggered runs in private repos - 5.2 Branch - #12983

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

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

Conversation

@desrosj

@desrosj desrosj commented Aug 12, 2026

Copy link
Copy Markdown
Member

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

Merge Conflict Resolution

The cherry-pick conflicted. The 5.2 branch only contains four workflow files (coding-standards.yml, javascript-tests.yml, phpunit-tests.yml, test-build-processes.yml), while the original commit touched twelve. Details of what was applied, dropped, and hand-adapted:

Jobs the condition was applied to (5 total)

File Job
.github/workflows/coding-standards.yml phpcs
.github/workflows/coding-standards.yml jshint
.github/workflows/javascript-tests.yml test-js
.github/workflows/phpunit-tests.yml test-php
.github/workflows/test-build-processes.yml test-core-build-process

All five previously used the identical gate if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} and were replaced with the canonical multi-line form from the source commit. No startsWith( github.repository, 'WordPress/' ) variants, no github.event.before clause, and no fork-only (! startsWith(...)) jobs exist on this branch, so none of the other shapes from the original commit were needed.

Files dropped (do not exist on the 5.2 branch)

These came through the cherry-pick as modify/delete conflicts and were removed with git rm so they are not newly created on this branch:

  • .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 (no upgrade-testing.yml equivalent exists on this branch either)
  • .github/workflows/workflow-lint.yml

Conflict resolution per file

  • coding-standards.yml — content conflict on the phpcs job only, because on this branch the if: is followed by a with: block (php-version: '7.3', old-branch: true) that does not exist on trunk. Resolved by taking the new multi-line if: and preserving this branch's with: block beneath it. The jshint job merged cleanly.
  • javascript-tests.yml — same shape of conflict on test-js, whose if: is followed by with: disable-apparmor: true on this branch. Resolved by taking the new if: and preserving the with: block.
  • phpunit-tests.yml — the largest divergence. Trunk has prepare-gutenberg, test-with-mysql, test-with-mariadb, test-with-sqlite, and a fork-only job; 5.2 has a single test-php job using reusable-phpunit-tests-v2.yml. The conflict attempted to import those trunk-only jobs wholesale. The file was restored to the upstream/5.2 version and the new if: was hand-applied to test-php only (the sole job on this branch matching the gate family). No trunk-only jobs were introduced.
  • test-build-processes.yml — auto-merged cleanly onto test-core-build-process; verified the condition landed on the correct job.

Intentionally left untouched

  • All slack-notifications and failed-workflow jobs in the four files — gated on github.event_name != 'pull_request' and unaffected.
  • test-build-processes.ymltest-core-build-process-macos, gated on if: ${{ github.repository == 'WordPress/wordpress-develop' }} only. It never runs for fork pull_request events, so it is not part of the gate family the commit targets.
  • The uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunkuses: ./.github/workflows/<x>.yml portion of the original commit was skipped: it applied only to upgrade-develop-testing.yml and workflow-lint.yml, neither of which exists on this branch, and this branch has no local reusable-*.yml files to reference.

Verification

  • git diff upstream/5.2 --stat shows only the four files above (40 insertions, 5 deletions).
  • No conflict markers remain under .github.
  • All four changed files parse as valid YAML via PyYAML, with their job lists intact.

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