Skip to content

Strict branch protection mis-blocks PRs: duplicate "Trunk Check" status context #757

@ss-o

Description

@ss-o

Problem

On next (strict required status checks include Trunk Check), PRs can show
mergeStateStatus: BLOCKED even when every check has succeeded, because two
distinct check-runs are both named Trunk Check
on the head SHA. Under strict
mode the required-context matcher does not cleanly reconcile the duplicate name,
so the merge is blocked despite all checks passing.

Observed on PR #756 (automated zsh-lint docs sync): all checks green
(Cloudflare Pages, CodeQL, Trunk Check x2, Analyze (*)), yet the merge
required an admin override.

Impact

Automated/bot PRs (e.g. the zsh-lint docs-sync/zsh-lint syncs) cannot
auto-merge and need a manual admin override each time.

Likely cause

Two workflows (or a workflow + the Trunk GitHub App) emit a status/check named
Trunk Check. Confirm via:

gh api repos/z-shell/wiki/commits/<sha>/check-runs --jq '.check_runs[]|{name,app:.app.slug}'

Fix options

  • Rename one of the colliding checks so the required context name is unique.
  • Or change the required context in branch protection to the precise,
    unambiguous check name actually produced by the canonical Trunk workflow.
  • Verify a subsequent automated sync PR merges without admin override.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions