Skip to content

Backport: Skip pull_request triggered runs in private repos - 6.7 Branch - #12991

Draft
desrosj wants to merge 2 commits into
WordPress:6.7from
desrosj:backport/6.7-branch-63183
Draft

Backport: Skip pull_request triggered runs in private repos - 6.7 Branch#12991
desrosj wants to merge 2 commits into
WordPress:6.7from
desrosj:backport/6.7-branch-63183

Conversation

@desrosj

@desrosj desrosj commented Aug 12, 2026

Copy link
Copy Markdown
Member

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

Merge Conflict Resolution

The cherry-pick conflicted. The 6.7 branch has a much smaller and differently shaped set of workflow files than trunk, so most of the commit had to be adapted by hand. Details below.

Files updated (14 job gates in total)

File Jobs updated
.github/workflows/coding-standards.yml phpcs, jshint
.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/phpunit-tests.yml test-with-mysql, test-with-mariadb
.github/workflows/test-build-processes.yml test-core-build-process, test-gutenberg-build-process
.github/workflows/upgrade-testing.yml upgrade-tests-wp-6x-mysql, upgrade-tests-wp-5x-php-7x-mysql, upgrade-tests-wp-5x-php-8x-mysql, upgrade-tests-wp-4x-php-7x-mysql, upgrade-tests-wp-4x-php-8x-mysql

Every one of these was previously gated with the plain if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} and now uses the canonical replacement:

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

coding-standards.yml, end-to-end-tests.yml, javascript-tests.yml, and php-compatibility.yml merged cleanly with no manual intervention.

Hunks dropped — files that do not exist on 6.7

The cherry-pick reported modify/delete conflicts for six workflow files that exist on trunk but not on 6.7. All six were git rm'd so that this backport does not introduce brand new workflows to a security-only 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.yml

Manual adaptations

  • phpunit-tests.yml — content conflict. The trunk version of this workflow has diverged substantially (a prepare-gutenberg job, per-secret secrets: blocks, startsWith( github.repository, 'WordPress/' ) && (...) wrappers, a test-innovation-releases job, and a separate fork-only job). None of that exists on 6.7. Resolution:

    • Dropped the incoming prepare-gutenberg job entirely — it does not exist on this branch.
    • Dropped the incoming test-innovation-releases job and the fork-only PHPUnit job — neither exists on this branch.
    • Kept 6.7's secrets: inherit rather than taking trunk's explicit CODECOV_TOKEN / WPT_REPORT_API_KEY block.
    • Kept 6.7's with: inputs (report: ${{ matrix.report || false }}) rather than trunk's gutenberg-artifact / gutenberg-sha inputs.
    • Because 6.7's test-with-mysql and test-with-mariadb jobs are not wrapped in startsWith( github.repository, 'WordPress/' ) && (...), the plain canonical form was applied to both rather than the startsWith() variant used on trunk. This preserves the existing behavior on this branch and only adds the private/draft/label narrowing.
  • test-build-processes.yml — the test-core-build-process job merged cleanly. The test-gutenberg-build-process job was updated by hand: that job no longer exists on trunk, so there was no corresponding hunk in the source commit, but its gate is of the same family and it runs on pull_request. The two macOS jobs (test-core-build-process-macos, test-gutenberg-build-process-macos) were left alone — they are gated github.repository == 'WordPress/wordpress-develop' only and never run on forks.

  • upgrade-testing.yml — all five gates applied by hand; there was no corresponding hunk in the source commit. Worth a careful look from a reviewer: on trunk, the touched workflow is upgrade-develop-testing.yml (added later in 24a2eac and never backported), while trunk's own upgrade-testing.yml was left untouched by r63183 because its jobs have since been narrowed to github.repository == 'WordPress/wordpress-develop' only. On 6.7 that narrowing never happened, so all five jobs still carry the || github.event_name == 'pull_request' gate and do fire for pull_request events (the workflow has a pull_request trigger with a paths filter on the workflow files themselves). Applying the change here is what preserves the intent of r63183 on this branch. If the preference is instead to leave this file untouched, that hunk can be dropped independently of the rest.

Not touched

  • All slack-notifications and failed-workflow jobs — gated on github.event_name != 'pull_request' and unaffected.
  • props-bot.yml and pull-request-comments.yml — not touched by the source commit and not equivalents of anything it touched.
  • The source commit also switched upgrade-develop-testing.yml and workflow-lint.yml from uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk to uses: ./.github/workflows/<x>.yml. Neither file exists on 6.7, so that part was skipped entirely. No other uses: line was changed.

Verification

  • git diff 6.7 --stat shows changes only under .github/workflows/ (7 files, +112/-14).
  • No conflict markers remain anywhere under .github.
  • All seven changed files parse as valid YAML, and the job count in each file is unchanged from 6.7.

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