mcpbeat Sign in

Checkout Credential Review Agent Skill

Review code that performs git or gh operations against repository checkouts in gh-aw, checking that the right credentials are available at the right time and that sparseness, shallowness and credential-free factors are properly considered.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
4864
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/github/gh-aw --skill checkout-credential-review

The instruction itself

4 sections, as written by the author

Checkout Credential Review

Use this skill when reviewing or writing code in pkg/workflow/, actions/setup/js/, or compiled .lock.yml workflows that runs git, gh, or any other remote-touching operation against a repository checkout.

Background

Each entry in a workflow's checkout: block may declare its own credentials (github-token:, github-app:), and the compiler wires those into the corresponding actions/checkout step (pkg/workflow/checkout_step_generator.go). Generated checkouts always set persist-credentials: false, so the on-disk repo retains no credentials after the step finishes — only actions/checkout's own internal token is used during the clone, and it is scrubbed in its post-step.

A separate step that wants to authenticate later must either (a) re-inject a token at command level (e.g. git -c http.extraheader=...) or (b) be passed the per-checkout token via env. The compiler does *not* automatically thread per-checkout github-tokens into downstream steps.

Two important contexts deliberately run with no git credentials:

  • The safe-outputs MCP server and its handlers (generate_git_bundle.cjs, generate_git_patch.cjs, create_pull_request.cjs). Errors in these paths explicitly say "the safe-outputs MCP server has no credentials for private repositories" — fetch/push will fail for private repos.
  • The agent runtime after actions/checkout. The agent prompt in actions/setup/md/safe_outputs_push_to_pr_branch.md explicitly tells the model not to attempt git fetch, git pull, git push, or any other authenticated git operation, and to report unavailable branches rather than try to fetch them.

Review checklist

When you see a new git, gh, execFileSync('git'…), or compiled run: block:

  • Does it touch a remote? Local-only commands (symbolic-ref, rev-parse, log, show, merge-base, diff, status) need no credentials. Anything in fetch | pull | push | clone | ls-remote | remote (set-url|add|update) does, plus on-demand blob fetches in partial clones.
  • Which checkout is it operating on? If it's a cross-repo entry from checkout:, the relevant credential is *that entry's* github-token, not the workflow's default GITHUB_TOKEN. Confirm the per-entry token is actually threaded into the step's env (or refuse to do remote operations and degrade gracefully).
  • Which job/context emits it? Agent job and safe-outputs MCP server both run without git credentials by design. Any remote git operation there must be wrapped in try/catch, fail soft, and surface a clear "no credentials" error rather than a raw git stderr.
  • Sparse / shallow / monorepo concerns. Avoid emitting steps that deepen (git fetch --unshallow, --deepen=N) or widen (git fetch origin '+refs/heads/*') a sparse or shallow checkout of a large monorepo — these need credentials *and* can pull hundreds of MB. Prefer expanding fetch: / fetch-depth: / sparse-checkout: at compile time so it happens during actions/checkout with its internal token, never later.
  • gh is REST, not git. gh api … uses whatever GH_TOKEN is in the step's env — it does not automatically inherit per-checkout PATs. For cross-org private repos, either thread the right token in or accept the call will 404 and handle it.
  • docs/src/content/docs/reference/checkout.md — "Git Credentials After Checkout"
  • docs/sparseness.md — sparse/blobless credential lifecycle
  • pkg/workflow/checkout_step_generator.go — token wiring per checkout
  • actions/setup/md/safe_outputs_push_to_pr_branch.md — agent-facing guidance

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take github/checkout-credential-review from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.