Skip to content

ci: release-gate.sh fails open if the second gh pr checks call errors #322

Closed

Description

@TMHSDigital

Why it matters

The release gate (#290) is meant to fail closed. Its second query swallows errors, so a transient gh failure (rate limit, 5xx, network) yields an empty bad, and the script prints "checks passed" and releases.

Evidence

.github/scripts/release-gate.sh:54

bad=$(gh pr checks "$pr" --repo "$repo" --json name,bucket --jq '[...] | join(", ")' 2>/dev/null) || true
if [ -n "$bad" ]; then ... exit 1; fi

Only the first call (count, ~line 47) is guarded with an error exit.

Suggested approach

Fetch name,bucket JSON once, fail closed if the command errors or the output is empty / not valid JSON, and compute both the count and the failing list from that single response.

Done when

A stubbed failing gh makes the gate exit 1 (add it as a unit test next to tests/test_measure_hero_drift.py or a shell test).

Activity

  1. added
    bug
    priority: medium
    on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcipriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions