Claude-skill-registry gh-workflows
Manage GitHub Actions workflows with the gh CLI (list, run, cancel, monitor).
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/gh-workflows" ~/.claude/skills/majiayu000-claude-skill-registry-gh-workflows && rm -rf "$T"
manifest:
skills/data/gh-workflows/SKILL.mdsource content
When to Use
Use this skill whenever you need to inspect, trigger, or stop GitHub Actions workflows. It wraps
gh workflow and gh run commands so you can keep CI pipelines healthy without leaving the terminal.
Prerequisites
CLI authenticated withgh
. Confirm viagh auth login --scopes repo,workflow
.gh auth status
available to pretty-print JSON results.jq- Environment:
(owner/name). Ask for it if missing.GITHUB_REPOSITORY
(gh uses it automatically once authenticated).GITHUB_TOKEN
(fallback for manual dispatches; default toDEFAULT_BRANCH
).main
Common Parameters
is required for every command.--repo "$GITHUB_REPOSITORY"
returns machine-friendly payloads.--json ... --jq '.'- When scripts provide
names, accept either filename (workflow
) or workflow ID.deploy.yml
Procedures
List Workflows (/workflows-list
)
/workflows-list- Run:
.gh workflow list --repo "$GITHUB_REPOSITORY" --limit ${LIMIT:-20} --json id,name,path,state - Use
to format the response.jq - Summarize key fields: name, path, state, and id so downstream commands can use them.
List Workflow Runs (/workflows-runs
)
/workflows-runs- Require a workflow identifier.
- Optional filters:
- Branch:
(omit if empty).--branch ${BRANCH} - Status:
.--status ${STATUS:-all}
- Branch:
- Command:
gh run list --repo "$GITHUB_REPOSITORY" \ --workflow "$WORKFLOW" \ ${BRANCH:+--branch "$BRANCH"} \ --status ${STATUS:-all} \ --limit ${LIMIT:-20} \ --json databaseId,workflowName,displayTitle,headBranch,status,conclusion,createdAt - Pipe to
and surface the most recent run id for convenience.jq '.'
View a Workflow Run (/workflows-view
)
/workflows-view- Accept a
(numeric or URL) and optionalrun_id
flag.--log - Command:
gh run view "$RUN_ID" --repo "$GITHUB_REPOSITORY" \ --json databaseId,workflowName,displayTitle,event,headBranch,status,conclusion,logsUrl,htmlUrl - Share the JSON and hyperlink to
/logsUrl
for quick navigation.htmlUrl
Cancel a Run (/workflows-cancel
)
/workflows-cancel- Confirm the run is in
orin_progress
state (usequeued
).gh run view - Command sequence:
gh run cancel "$RUN_ID" --repo "$GITHUB_REPOSITORY" gh run watch "$RUN_ID" --repo "$GITHUB_REPOSITORY" --exit-status || true - Report the final status (cancelled/completed). If already finished, note that cancellation was skipped.
Trigger a Workflow (/workflows-trigger
)
/workflows-trigger- Require workflow file/ID plus ref/branch.
- Compose inputs:
EXTRA_INPUTS=${INPUTS_JSON:+--inputs "$INPUTS_JSON"} gh workflow run "$WORKFLOW" --repo "$GITHUB_REPOSITORY" --ref "${REF:-${BRANCH:-$DEFAULT_BRANCH}}" $EXTRA_INPUTS - Capture the run id from gh output and share it for monitoring.
Monitor a Run (/workflows-monitor
)
/workflows-monitor- Command:
.gh run watch "$RUN_ID" --repo "$GITHUB_REPOSITORY" --exit-status - Stream output back. At completion, annotate whether the run concluded with success, failure, or cancellation.
Safety Checks
- Never cancel or rerun workflows outside the configured repo.
- If a command fails due to missing repo/ref, prompt the user for the missing data before retrying.
- Treat manual dispatch inputs carefully—validate JSON before passing
.--inputs