Fix duplicate Code Owners checks on PRs#12758
Merged
petebacondarwin merged 1 commit intomainfrom Mar 4, 2026
Merged
Conversation
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
74cad8f to
2cc31f0
Compare
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
2cc31f0 to
87fe4e6
Compare
87fe4e6 to
65612d3
Compare
0ecf97d to
9e14b8c
Compare
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.
9e14b8c to
535a10c
Compare
dario-piotrowicz
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the issue where PRs show two separate "Code Owners" checks — one passing and one failing.
Problem: When
pull_request_targetandpull_request_reviewtriggers are in the same workflow file, GitHub creates separate check contexts for each event type (Code Owners on: pull_request_targetandCode Owners on: pull_request_review). This means:pull_request_targetfires → codeowners-plus evaluates → fails (no approvals yet)pull_request_reviewfires → codeowners-plus evaluates → passespull_request_targetcheck still shows as failed alongside the passingpull_request_reviewcheckFix: Split into two workflows, following the pattern recommended by codeowners-plus:
codeowners.yml— keeps only thepull_request_targettrigger and runs the actual codeowners-plus evaluation (single check context)rerun_codeowners.yml(new) — triggered bypull_request_review, re-runs the existing check job via the GitHub API usingghCLI (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.)