Skip to content

bug: gh --jq flag doesn't support --arg, quality gate check always blocks #207

@microsasa

Description

@microsasa

Problem

PR #202 introduced a Copilot review in-progress check before dispatching the quality gate:

COPILOT_REVIEW_RUNNING=$(gh run list --workflow="Copilot code review" --json headSha,status --jq --arg sha "$HEAD_SHA" '[...]' 2>/dev/null || echo "1")

The --jq flag on gh run list does NOT support jq's --arg parameter. The --arg sha is interpreted as an unknown command argument, causing the command to error:

unknown command "sha" for "gh run list"

Because of the || echo "1" fail-safe fallback, the error is swallowed and the check always returns 1 — permanently reporting "Copilot review in progress" and blocking all quality gate dispatches.

Impact

The orchestrator can never dispatch the quality gate. Every run logs:

⏳ PR #N: Copilot review in progress. Skipping quality gate.

Fix

Pipe gh run list output to jq separately instead of using --jq:

COPILOT_REVIEW_RUNNING=$(gh run list --workflow="Copilot code review" --json headSha,status 2>/dev/null | jq -r --arg sha "$HEAD_SHA" '[.[] | select(.headSha == $sha) | select(.status == "in_progress" or .status == "queued")] | length' 2>/dev/null || echo "1")

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions