Skip to content

Status Check Operations

Debugging Failed Checks

Quick Start

This guide is part of a modular documentation set. Refer to related guides in the navigation for complete context.

View Check Details

# Get check run details
gh api repos/org/repo/commits/abc123/check-runs \
  --jq '.check_runs[] | {name, conclusion, output}'

Re-run Failed Checks

# Re-run specific check
gh api --method POST \
  repos/org/repo/check-runs/CHECK_ID/rererun

Check Status URL

Every PR shows status check URLs. Click through to workflow logs.


Evidence for Auditors

Demonstrate enforcement with API queries:

# Show all PRs from March 2025 had required checks
gh api 'repos/org/repo/pulls?state=closed&base=main' \
  --jq '.[] | select(.merged_at | startswith("2025-03")) |
    {pr: .number, checks: .statuses_url}'

For each PR, show check results:

gh api repos/org/repo/commits/COMMIT_SHA/check-runs \
  --jq '.check_runs[] | {name, conclusion}'

Auditors verify all merged code passed required checks.


Cost Optimization

GitHub Actions minutes cost money. Optimize checks:

Cache Dependencies

- uses: actions/cache@v4
  with:
    path: |
      ~/.cache/go-build
      ~/go/pkg/mod
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

Path Filtering

on:
  pull_request:
    paths:
      - '**.go'
      - 'go.mod'
      - 'go.sum'

Don't run Go tests when only markdown changed.

Self-Hosted Runners

runs-on: [self-hosted, linux, x64]

Free compute for private repos.



Required checks blocked the PR. Tests failed. Vulnerabilities found. The code didn't merge. The pipeline worked.

Comments