github-actions-pat

A guide and script for inspecting failed GitHub Actions runs through GitHub’s REST API. GitHub Actions is GitHub’s service for running automated checks and deployments.

In plain words
What is it for?
Use it to investigate CI failures by run, pull request, commit, or branch; fetch logs; review pull requests; and monitor a new run after pushing a fix.
Why use it?
It helps locate failed jobs and steps, retrieve logs, review pull-request changes, and repeat the fix, push, and check cycle. It requires a personal access token in the GITHUB_TOKEN environment variable.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bifrost-proxy/bifrost/github-actions-pat
Any agent
npx skills add bifrost-proxy/bifrost --skill github-actions-pat
Clone the repo
git clone --depth 1 https://github.com/bifrost-proxy/bifrost

Made for: Claude Code, Codex.

Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,217 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00109 $0.03217
Opus 5 $0.00055 $0.01608
Sonnet 5 $0.00022 $0.00643
Haiku 4.5 $0.00011 $0.00322

Measured 2d ago against content hash e950fbe8e7b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

github-actions-pat scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/common.py, scripts/gh_ci.py, scripts/gh_review.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

如果用户本机挂了代理(包括 bifrost 自己),Python 的 `urllib` 可能因 `Missing Authority Key Identifier` 而 `CERTIFICATE_VERIFY_FAILED`。跑脚本时 **主动清掉代理环境变量**:
.agents/skills/github-actions-pat/SKILL.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GitHub Actions PAT Inspector

把"用 PAT 分析 GitHub Actions CI"这条路径固化成可复用脚本。本 skill 解决的典型场景:

  1. Agent 在 bifrost remote 目标机或 caller 上跑,必须走 REST API 自动化,不走浏览器 cookie
  2. 需要自动化「修 → push → 盯 CI → 失败继续修」的闭环
  3. 需要按 run-id / PR / sha / branch 精确定位失败并拉 job log
  4. 需要做 PR diff review(生成 markdown 或直接 POST)

auth 唯一路径:PAT 从 GITHUB_TOKEN 环境变量读取。不支持、不回退到 cookie / OAuth device flow / SSH / gh CLI 登录等其他方式。需要 agent 自主跑的 CI 分析、PR review、fix-push-watch 循环,全部用本 skill。

授权契约(唯一输入:GITHUB_TOKEN 环境变量)

  • 本 skill 只从环境变量 GITHUB_TOKEN 读 token。不落盘、不写日志、不回显原文。
  • 读取方式推荐(适配用户 shell 配置):
    # macOS / zsh 用户:交互式 shell 才会加载 ~/.zshrc
    zsh -ic 'python3 scripts/gh_ci.py run <run_id>'
    # bash 用户
    bash -lc 'python3 scripts/gh_ci.py run <run_id>'
    # 或在脚本运行前已 export GITHUB_TOKEN 的环境
    python3 scripts/gh_ci.py run <run_id>
    
  • 未设置 → 脚本 exit 2,提示 ERROR: set GITHUB_TOKEN before running this skill
  • 推荐 scope:repo + actions:read(只读分析)。--post 发 review 时额外需要 pull_requests:write
  • 首选 fine-grained PAT 并把 repo 限定到目标仓库,爆炸半径最小。

仓库定位策略

脚本默认读环境变量 GH_REPO(格式 owner/repo),未设置时回退到本仓库。Agent 可在调用前写入:

export GH_REPO=bifrost-proxy/bifrost
python3 scripts/gh_ci.py pr 567

或者在 AGENTS.md 顶部的仓库元信息中固化。

目录结构

scripts/
├── common.py         # token/http/分页/日志切片/归因
├── gh_ci.py          # run / pr / sha / branch / regression
├── gh_review.py      # PR metadata + diff + 分层建议 + 可选 --post
└── poll_run.py       # 轮询一个 run 直到完成
references/
└── pitfalls.md       # GitHub API 坑点清单(job log 302、Accept 415、system proxy MITM)

典型调用

(A) CI 错误定位

# 按 run-id 分析
python3 scripts/gh_ci.py run 25269751068

# 按 PR 号找最近一次 failed
python3 scripts/gh_ci.py pr 567

# 按 commit sha 找
python3 scripts/gh_ci.py sha a96a4257

# 按分支找最近一次 failed
python3 scripts/gh_ci.py branch feat/agent --only-failed

# 与上一次 green 做 regression 对比(给出 compare URL + 提交区间)
python3 scripts/gh_ci.py regression 25269751068

脚本行为:

  1. GET /repos/{owner}/{repo}/actions/runs/... 拉 run 元数据
  2. GET .../jobs 筛出 conclusion=failure
  3. 对每个 failed job:GET .../jobs/{id}/logs自动处理 302 到 Azure Blob signed URL(不能带 Authorization)
  4. 日志末尾 500 行扫关键词(error:FAILpanicked##[error]thread '...' panickedtest result: FAILED 等),抽 ±20 行上下文
  5. 输出结构化 markdown:失败 job / step / URL / 根因桶(compile / test / lint / fmt / timeout / network / OOM)/ 关键日志片段 / 本地复现命令

Read the full file on GitHub · 202 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 202 lines · 109 tokens per session scan A e950fbe8e7b8

Subscribe to this mod's changes

github-actions-pat is a skill published in the GitHub repository bifrost-proxy/bifrost (124 stars, last pushed 3d ago), licensed MIT. It adds 109 tokens to every session and 3,217 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

aws-solution-architect

Design AWS architectures for startups using serverless patterns and IaC templates. Use when asked to design serverless architecture, create CloudFormation templates, optimize AWS costs, set up CI/CD pipelines, or migrate to AWS. Covers Lambda, API Gateway, DynamoDB, ECS, Aurora, and cost optimization.

seaworld008/Commonly-used-high-value-skills · 66 tokens

cc-devops-skills

SRE, DevOps, Kubernetes, CI/CD, PromQL, Terraform, Docker, and incident operations playbook for building reliable delivery and operations workflows.

seaworld008/Commonly-used-high-value-skills · 37 tokens

ci-cd-and-automation

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

seaworld008/Commonly-used-high-value-skills · 45 tokens

github

Interact with GitHub using the gh CLI to manage repositories, issues, pull requests, CI/CD workflow runs, and API queries. Use when the user asks to create, list, view, merge, or close pull requests and issues; check CI status or workflow run logs; query the GitHub API for repository data; or perform any GitHub…

elizaOS/eliza · 104 tokens

baby-sit

Monitor a GitHub pull request until CI is green, diagnose failures, and rerun only evidence-backed flaky GitHub Actions jobs.

langchain-ai/open-swe · 30 tokens

pipeline-investigation

Investigates Buildkite pipeline failures to find root causes. Returns structured JSON to the parent for formatting. Triggers when users ask about failing pipelines, build errors, or need help debugging CI/CD issues. Accepts Buildkite build URLs or build numbers and performs deep investigation.

mock-server/mockserver-monorepo · 58 tokens