Skip to content

Fix duplicate Code Owners checks on PRs#12758

Merged
petebacondarwin merged 1 commit intomainfrom
fix-codeowners-duplicate-checks
Mar 4, 2026
Merged

Fix duplicate Code Owners checks on PRs#12758
petebacondarwin merged 1 commit intomainfrom
fix-codeowners-duplicate-checks

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Mar 4, 2026

Fixes the issue where PRs show two separate "Code Owners" checks — one passing and one failing.

Problem: When pull_request_target and pull_request_review triggers are in the same workflow file, GitHub creates separate check contexts for each event type (Code Owners on: pull_request_target and Code Owners on: pull_request_review). This means:

  1. PR opened → pull_request_target fires → codeowners-plus evaluates → fails (no approvals yet)
  2. Review submitted → pull_request_review fires → codeowners-plus evaluates → passes
  3. The stale pull_request_target check still shows as failed alongside the passing pull_request_review check

Fix: Split into two workflows, following the pattern recommended by codeowners-plus:

  • codeowners.yml — keeps only the pull_request_target trigger and runs the actual codeowners-plus evaluation (single check context)
  • rerun_codeowners.yml (new) — triggered by pull_request_review, re-runs the existing check job via the GitHub API using gh CLI (no third-party action needed). This updates the original check rather than creating a second one.

Also skips codeowners-plus evaluation for Version Packages PRs (changeset-release/main) which only need wrangler team approval and are already protected by native GitHub CODEOWNERS. The job still runs and reports a passing status, but skips the checkout, diff fetch, and evaluation steps. (Supersedes #12749.)


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: CI workflow change — will be validated when the next review is submitted on a PR
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal CI workflow change

Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 9e14b8c8091f0d95b6586f41ea97ee53e119916f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Mar 4, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 4, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12758

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12758

miniflare

npm i https://pkg.pr.new/miniflare@12758

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12758

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12758

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12758

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12758

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12758

wrangler

npm i https://pkg.pr.new/wrangler@12758

commit: 98e2fe8

@petebacondarwin petebacondarwin force-pushed the fix-codeowners-duplicate-checks branch from 74cad8f to 2cc31f0 Compare March 4, 2026 15:57
@petebacondarwin petebacondarwin marked this pull request as ready for review March 4, 2026 16:00
@petebacondarwin petebacondarwin requested a review from a team as a code owner March 4, 2026 16:00
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 4, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

@petebacondarwin petebacondarwin force-pushed the fix-codeowners-duplicate-checks branch from 2cc31f0 to 87fe4e6 Compare March 4, 2026 16:31
devin-ai-integration[bot]

This comment was marked as resolved.

@petebacondarwin petebacondarwin force-pushed the fix-codeowners-duplicate-checks branch from 87fe4e6 to 65612d3 Compare March 4, 2026 17:51
devin-ai-integration[bot]

This comment was marked as resolved.

@petebacondarwin petebacondarwin force-pushed the fix-codeowners-duplicate-checks branch 2 times, most recently from 0ecf97d to 9e14b8c Compare March 4, 2026 18:09
devin-ai-integration[bot]

This comment was marked as resolved.

When both pull_request_target and pull_request_review triggers are in
the same workflow, GitHub creates separate check contexts for each
event type. This causes two 'Code Owners' checks to appear on PRs —
one from the initial PR event (often stale/failing) and one from the
review event (current/passing).

Split the workflow into two files:
- codeowners.yml: keeps only the pull_request_target trigger and runs
  the actual codeowners-plus evaluation
- rerun_codeowners.yml: triggered by pull_request_review, re-runs the
  existing check job via the GitHub API instead of creating a new one

This ensures only a single Code Owners check appears on each PR.

Also skip codeowners-plus evaluation for Version Packages PRs
(changeset-release/main) which only need wrangler team approval and
are already protected by native GitHub CODEOWNERS.
@petebacondarwin petebacondarwin force-pushed the fix-codeowners-duplicate-checks branch from 9e14b8c to 535a10c Compare March 4, 2026 19:04
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 4, 2026
@petebacondarwin petebacondarwin merged commit 67ab88b into main Mar 4, 2026
46 of 55 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 4, 2026
@petebacondarwin petebacondarwin deleted the fix-codeowners-duplicate-checks branch March 4, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants