Skip to content

Backport: Skip pull_request triggered runs in private repos - 6.8 Branch - #12992

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

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

Conversation

@desrosj

@desrosj desrosj commented Aug 12, 2026

Copy link
Copy Markdown
Member

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

Merge Conflict Resolution

The cherry-pick conflicted in every file it touched. The if: gate on the 6.8 branch carries an
extra github.actor != 'dependabot[bot]' clause that no longer exists on trunk, so no hunk applied
cleanly. Additionally, phpunit-tests.yml on 6.8 differs substantially from trunk (no
prepare-gutenberg job, secrets: inherit instead of explicit secrets, no
startsWith( github.repository, 'WordPress/' ) gating, no fork-only job), which made that file's
conflicts unusable.

Rather than hand-editing conflict hunks that contained unrelated trunk-only content, every
conflicted file was reset to its 6.8 content and the condition change was applied by hand to each
qualifying job.

Adapted condition shape

Because 6.8 gates on dependabot as well, the standard replacement used here preserves that clause:

    if: |
      github.repository == 'WordPress/wordpress-develop' || (
        github.event_name == 'pull_request' &&
        github.actor != 'dependabot[bot]' && (
          ! github.event.repository.private ||
          ! github.event.pull_request.draft ||
          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
        )
      )

Jobs updated by hand (14 total)

File Job(s)
.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/performance.yml determine-matrix
.github/workflows/php-compatibility.yml php-compatibility
.github/workflows/phpunit-tests.yml test-with-mysql, test-with-mariadb, test-innovation-releases, specific-test-groups
.github/workflows/test-build-processes.yml test-core-build-process, test-gutenberg-build-process
.github/workflows/upgrade-develop-testing.yml upgrade-tests-develop
.github/workflows/workflow-lint.yml lint

performance.yml's determine-matrix job additionally keeps its
&& ! contains( github.event.before, '00000000' ) clause, matching the shape used on trunk:

    if: |
      (
        github.repository == 'WordPress/wordpress-develop' || (
          github.event_name == 'pull_request' &&
          github.actor != 'dependabot[bot]' && (
            ! github.event.repository.private ||
            ! github.event.pull_request.draft ||
            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
          )
        )
      ) &&
      ! contains( github.event.before, '00000000' )

Hunks dropped

  • .github/workflows/javascript-type-checking.yml — does not exist on 6.8. The cherry-pick left the
    trunk version of the whole file in the tree; it was git rm'd rather than created.
  • .github/workflows/phpstan-static-analysis.yml — does not exist on 6.8. Same handling as above.
  • .github/workflows/test-and-zip-default-themes.yml — does not exist on 6.8. Same handling as above.
  • phpunit-tests.yml: the prepare-gutenberg job, the gutenberg-artifact/gutenberg-sha inputs,
    the explicit CODECOV_TOKEN/WPT_REPORT_API_KEY secrets blocks, the
    startsWith( github.repository, 'WordPress/' ) && ( ... ) outer wrapper, and the fork-only
    test-with-mysql variant job all came along with the conflict but do not exist on 6.8. None were
    introduced. Only the if: lines on the four existing jobs were changed.
  • The uses: WordPress/wordpress-develop/.github/workflows/<x>.yml@trunk
    uses: ./.github/workflows/<x>.yml change from the original commit was not carried over for
    upgrade-develop-testing.yml or workflow-lint.yml. The 6.8 branch contains no reusable-*.yml
    workflow files at all, so the local references would not resolve.
  • upgrade-develop-testing.yml: the original commit also updated the build job and the
    upgrade-tests-develop-forks job. Neither has an if: gate (the build job) or exists at all
    (upgrade-tests-develop-forks) on 6.8, so those hunks were dropped.

Deliberately left untouched

  • .github/workflows/upgrade-testing.yml — exists on both trunk and 6.8 and was not touched by the
    original commit. Note that its jobs on 6.8 do carry the || ( pull_request && ! dependabot )
    family gate (on trunk they are gated on github.repository == 'WordPress/wordpress-develop'
    only). Flagging this in case it should be included; it was left alone to match the scope of r63183.
  • .github/workflows/local-docker-environment.yml — same situation: has the family gate on 6.8, but
    the original commit did not touch this workflow on trunk.
  • All Slack notification jobs (gated on github.event_name != 'pull_request', unaffected).
  • props-bot.yml, pull-request-comments.yml, cleanup-pull-requests.yml, check-built-files.yml.

Verification

  • git diff upstream/6.8 --stat shows only files under .github/workflows/ (9 files, +129/-14).
  • git grep -n -E '^(<<<<<<<|=======|>>>>>>>)' -- .github returns nothing.
  • All 15 workflow files on the branch parse with PyYAML; the 14 updated if: expressions were
    re-serialized and inspected to confirm the boolean grouping is correct.

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