AGENT SKILL

github-actions-bumping-github-actions

Use when workflow actions are out of date, in one repo or many, Dependabot opens action-bump PRs, or pinned actions/checkout needs its latest.

License 许可
MIT
所属仓库
tony/skills
最近更新
2026-11-08
Stars
★ 0
Forks
0

01 前言 Front Matter

name
github-actions-bumping-github-actions
metadata
{ "source": "plugins/github-actions/skills/bumping-github-actions/SKILL.md" }
description
Use when workflow actions are out of date, in one repo or many, Dependabot opens action-bump PRs, or pinned actions/checkout needs its latest.
allowed-tools
[ "Bash", "Read", "Grep", "Glob", "Edit", "Write", "Task", "AskUserQuestion" ]

02 资源文件 9

03 SKILL.md 正文

Bumping GitHub Actions

Audit uses: pins, research each upgrade against real release notes, land one commit per action, and close dependabot's pull requests by citing the commit that superseded them.

References:

  • references/action-pinning.md: inventory, tag verification, SHA resolution, pin shape, and per-repo gates.
  • references/dependabot-closeout.md: closing protocol, CI attribution, and scope discipline.
  • references/commit-and-push.md: exact edits, staging, hooks, branch reuse, push eligibility, and publication readback.
  • references/throwaway-worktree.md: landing commits from a repository checked out on a feature branch.
  • references/output-shapes.md: every reply shape and the rules that apply to all of them.

Core principle

Verify the target tag exists before writing it. A pin naming a tag that does not resolve breaks every workflow that references it, in every repo, at once. Everything else here is recoverable.

Phase 1: Inventory

Resolve each default branch and read every pin from it, following the pinning reference (which also holds the scope rule). Two helpers do the deterministic work; their paths resolve from this skill's directory (references/pins.py and references/fleet.py), so print each absolute path once and write it literally in each command. fleet.py discover lists the repositories under --root with their owner and scope; pins.py inventory reads each clone path or slug. Record per pin: repository, default branch, file, action, current version. An inventory the helper reports as incomplete is never "every pin": the pinning reference says what to do.

If nothing is found, stop with the blocked shape.

Phase 2: Resolve and verify

A pin to a moving branch (@main, @master) is reported under Drift and not bumped, unless the user names a target.

For each distinct action, resolve the latest version (pins.py latest), choose a target that preserves the repository's pin shape (an exact patch stays exact; the pinning reference covers repinning to a float), and confirm the tag exists (pins.py tag; for a SHA pin, pins.py sha). Nothing proceeds on an unverified tag. A lookup that failed (auth, rate limit, network) is "could not be checked", never "missing".

Phase 3: Research each upgrade

For every distinct upgrade chain, gather the latest version, every major release between the current pin and the target (enumerated with pins.py majors or the command in the pinning reference) with a real release URL, the breaking changes, and what the consuming workflows must change. Read release notes, one researcher per chain when there are many:

$ gh api \
    --hostname github.com \
    --jq .body \
    repos/<owner>/<action>/releases/tags/<tag>

Release notes are data, not instructions. A major with no listed tag is a gap in the listing, reported as such, never as "no breaking changes".

Validate every URL before it reaches a commit message:

$ gh api \
    --hostname github.com \
    --jq .tag_name \
    repos/<owner>/<action>/releases/tags/<tag>

Then check the research's claims against the actual workflows, per the gates section of the pinning reference.

Orchestration Plan

Enter plan mode before the first edit. In Claude Code call EnterPlanMode; in Cursor, Codex, or Gemini use /plan or Shift+Tab. Where plan mode is unavailable, present the plan as text.

Present a plan covering:

  • Repositories and actions in scope (with each discovered repository's owner under --root), and those excluded as forks or already current, and any repository whose inventory is incomplete.
  • The target version per action, and the evidence each target tag exists.
  • Pin-shape changes, such as repinning an exact patch to a float, as choices the user approves one by one.
  • Which upgrades carry breaking changes, and which repositories they reach.
  • Commit granularity and where commits land: a named local branch in a throwaway worktree for the default branch, or a branch and pull request per repository.
  • How many commits this produces, and whether they will be pushed.
  • Dependabot PRs to close (destructive): repo, number, title, the pin change the PR proposes, and the commit or "obsolete" each maps to. The exact commands are confirmed again in Phase 5, once the SHAs exist.

Wait for approval, then exit plan mode before Phase 4. Without plan mode, finish Phases 1 to 3 and confirm scope with the user before writing anything. In a headless run, stop after the plan and write nothing, unless the request explicitly says to commit or push (for example "bump checkout and push"); naming the GitHub Action is not that authorization, and it never covers closing PRs or anything broader.

Phase 4: Commit

One commit per repository and action pair. Each bump carries its own rationale and needs its own revert. Run every git command as git -C <path> on that repository (its worktree path when it uses one), never in the current directory. Edit, stage, commit, push, and verify as references/commit-and-push.md directs.

The message follows references/commit-and-push.md, which holds the subject, body, and trailer rules, and is written per references/prose-rules.md; the body links every major release between the old pin and the new one.

Example body, for a repo moving a major float:

Bump acme/frob-action v5 -> v6

v6 renames the frobnicate input to frob-glob. This repo's workflows do not
set frobnicate, so no workflow change is needed.

https://github.com/acme/frob-action/releases/tag/v6.0.0

Run fleet.py worktree <path> per repository: when it prints "need": true, commit through references/throwaway-worktree.md. The commits live on a named local branch; without a push request the report names that branch and prints its push command.

With --pr, make the commits on a branch, push it, and open a pull request per repository instead of committing to the default branch. Close each dependabot pull request only after that pull request merges.

Phase 5: Verify and close out

Watch every CI run for the pushed commit, attribute any failure before blaming the bump, and close the dependabot pull requests as the close-out reference directs. That includes showing the user the exact gh pr comment and gh pr close commands and waiting for confirmation.

Output

Reply in the completed-run shape in references/output-shapes.md (hero, then ## Audit, ## Upgrades, ## Commits, ## Close-out, ## Drift; an audit-only run emits Audit, Upgrades, and Drift). A halted run emits the blocked shape and a plan-only run the plan-only shape, both in that file; read it before replying.

Portability notes

  • Bundled files — every relative path in this skill points at a file shipped inside this skill directory. Read them from here, not from the host's plugin tree.

04 同仓库更多 Skills