checkout-credential-review

Review git and gh operations in gh-aw workflows for correct credential availability and sparse-checkout handling.

5.1k|530|Updated Aug 12, 2025
One-click install
npx skills add https://github.com/github/gh-aw --skill checkout-credential-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: checkout-credential-review
Source: https://github.com/github/gh-aw/tree/main/.github/skills/checkout-credential-review
Command: npx skills add https://github.com/github/gh-aw --skill checkout-credential-review

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Code that runs git or gh commands against repository checkouts in gh-aw can silently fail or leak credentials when the wrong token is used, when credentials are missing in credential-free contexts, or when sparse and shallow checkouts are deepened at runtime. This Skill gives reviewers a concrete checklist to catch those issues before they ship.

Core Features & Use Cases

  • Credential wiring review: Verifies that per-checkout github-token values from the checkout: block are actually threaded into downstream steps rather than assuming the default GITHUB_TOKEN applies.
  • Credential-free context checks: Confirms that remote git operations in the agent job and safe-outputs MCP server fail soft with clear no-credentials errors instead of raw git stderr.
  • Sparse and shallow safety: Flags steps that deepen or widen sparse, shallow, or blobless monorepo checkouts at runtime instead of expanding fetch options at compile time.
  • Use Case: While reviewing a pull request that adds a git fetch step to a compiled .lock.yml workflow, use this Skill to determine whether the step has credentials, which checkout entry it targets, and whether it should instead be handled by actions/checkout configuration.

Quick Start

Review the git and gh commands in this pull request against the checkout credential checklist and report any missing tokens or unsafe fetch operations.

Frequently Asked Questions about checkout-credential-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review git credential usage in GitHub Actions workflows?

Check whether each git command touches a remote, identify which checkout entry it operates on, and confirm the matching per-checkout github-token is threaded into the step's environment. Local-only commands like log, diff, and rev-parse need no credentials.

Why does git fetch fail in the gh-aw safe-outputs MCP server?

The safe-outputs MCP server deliberately runs with no git credentials, so fetch and push fail for private repositories. Handlers must wrap remote operations in try/catch and surface a clear no-credentials error rather than raw git stderr.

Does actions/checkout persist credentials for later steps?

No. Generated checkouts in gh-aw set persist-credentials: false, so the on-disk repo retains no credentials after the step finishes. Later steps must re-inject a token via git -c http.extraheader or receive it through environment variables.

Does gh api use the per-checkout token automatically?

No. gh api uses whatever GH_TOKEN is set in the step's environment and does not inherit per-checkout PATs. For cross-org private repositories you must thread the correct token in explicitly or handle the resulting 404.

When should I avoid git fetch --unshallow in a workflow step?

Avoid deepening or widening fetches at runtime on sparse or shallow monorepo checkouts, since they need credentials and can pull hundreds of megabytes. Prefer expanding fetch-depth or sparse-checkout options at compile time so actions/checkout handles it with its internal token.