github-actions-gen

github-actions-gen is a skill for Claude Code, Codex from laolaoshiren/claude-code-skills-zh. It costs 57 tokens per session (1,910 once invoked), scanned A, original, MIT.

A guide for creating or updating GitHub Actions workflows, which are automated jobs that test, build, release, or deploy code. It first examines the real project before choosing commands, runtimes, caches, and permissions.

In plain words
What is it for?
Use it to set up continuous integration, test matrices, builds, releases, deployments, caching, secrets, OpenID Connect access, or pull-request automation. It also helps diagnose existing workflow files and validate them with real project commands.
Why use it?
It avoids workflows based on guesses and reduces risks from untrusted pull requests, excessive permissions, floating action versions, exposed secrets, and unverified configuration.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to set up continuous integration, test matrices, builds, releases, deployments, caching, secrets, OpenID Connect access, or pull-request automation. It also helps diagnose existing workflow files and validate them with real project commands.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/laolaoshiren/claude-code-skills-zh/github-actions-gen
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.

Any agent
npx skills add laolaoshiren/claude-code-skills-zh --skill github-actions-gen
Clone the repo
git clone --depth 1 https://github.com/laolaoshiren/claude-code-skills-zh

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for github-actions-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/laolaoshiren/claude-code-skills-zh/github-actions-gen/github.svg)](https://agentmods.dev/skills/laolaoshiren/claude-code-skills-zh/github-actions-gen)
Your own site
<a href="https://agentmods.dev/skills/laolaoshiren/claude-code-skills-zh/github-actions-gen"><img src="https://agentmods.dev/badge/skills/laolaoshiren/claude-code-skills-zh/github-actions-gen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for github-actions-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/laolaoshiren/claude-code-skills-zh/github-actions-gen"><img src="https://agentmods.dev/badge/skills/laolaoshiren/claude-code-skills-zh/github-actions-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,910 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00057 $0.01910
Opus 5 $0.00028 $0.00955
Sonnet 5 $0.00011 $0.00382
Haiku 4.5 $0.00006 $0.00191

Measured 9d ago against content hash b0e639948cdc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

github-actions-gen scanned grade A with 0 findings 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 9d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/github-actions-gen/SKILL.md · 144 lines

How it starts

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

GitHub Actions CI/CD 生成器

核心原则

  • 先读项目,再生成 workflow。不要凭项目名猜测运行时、包管理器、测试命令或部署目标。
  • 默认只生成只读 CI。Release、部署、推送镜像、写回仓库和调用外部 webhook 必须先确认目标、凭据、环境保护与回滚方式。
  • 将不可信 PR 代码与 Secrets、写权限、自托管 Runner 隔离。不要为方便而改用 pull_request_target 执行 PR 代码。
  • 把所有 Action 固定到核验过的完整 40 位 commit SHA,并在旁边保留版本注释。不要使用 @main@master@latest 或可移动的 @vN tag。
  • 为每个 job 设置最小 permissionstimeout-minutes;不依赖仓库默认权限。
  • 生成后运行真实语法与项目命令验证,不把“配置看起来正确”当作通过。

工作流程

1. 盘点项目证据

  • 读取 manifest、lockfile、wrapper、运行时文件和现有 workflow,例如 package.json.nvmrcpyproject.tomlgo.modCargo.tomlDockerfile.github/workflows/
  • 从项目脚本、贡献文档和现有 CI 确认 lint、test、build、package 命令。命令不存在时先指出缺口。
  • 识别 monorepo 边界、工作目录、矩阵维度、服务容器、缓存路径与产物。
  • 询问必要决策:触发分支、支持的运行时、部署目标、云账号、GitHub Environment、失败处理和发布授权。
  • 检查当前工作树,保留用户已有修改;只编辑本次授权的 workflow 和必要配置。

2. 建立威胁模型

  • pull_request:按不可信代码处理,使用只读 Token,不提供 Secrets,不在高权限自托管 Runner 上执行 fork 代码。
  • pull_request_target:仅处理标签、评论等可信基准分支逻辑;绝不 checkout PR head、运行 PR 脚本或安装 PR 依赖。
  • push / tag / workflow_dispatch:仍需限制分支、输入、Environment 和权限;写操作放入独立 job。
  • 避免把 ${{ github.event.* }} 等不可信表达式直接插进 run:。通过 env: 传值,并在脚本中按数据处理。
  • 不把 Secrets 写入命令行、日志、缓存、Artifact 或 PR 评论;fork PR 缺少 Secrets 是正常安全边界。

3. 设计最小流水线

优先拆分职责:

  • ci.yml:lint、test、build;pull_request 与受控 push 触发,只读权限。
  • release.yml:仅在用户明确要求时生成;使用受保护 tag 或手动触发。
  • deploy.yml:仅在部署目标明确时生成;使用 GitHub Environment、并发控制和最小 OIDC / Secrets 权限。

为耗时 job 设置取消策略和超时。矩阵只覆盖项目真正支持的版本;缓存 key 必须包含 lockfile,不能缓存凭据和构建秘密。

4. 核验并固定 Action

  • 从 Action 官方仓库 release / tag 解析完整 commit SHA,核对仓库所有者、版本说明和运行时要求。
  • 采用 uses: owner/action@<40位SHA> # vX.Y.Z 格式。版本注释用于阅读,SHA 才是执行边界。
  • actions/checkout 默认设置 persist-credentials: false。只有后续步骤确实要执行经过授权的 Git 写入时才保留凭据,并限制 job 权限。
  • 使用 Dependabot 或人工维护流程更新 SHA;更新时重新阅读 release notes,不盲目替换。
  • 本文示例 SHA 核验于 2026-07-22;实际生成时应重新核验官方 release。

5. 生成 workflow

下面示例假设项目已有 .nvmrcpackage-lock.jsonlinttestbuild 脚本:

name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

permissions:
  contents: read

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false

      - name: 配置 Node.js
        uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
        with:
          node-version-file: .nvmrc
          cache: npm
          cache-dependency-path: package-lock.json

      - name: 安装依赖
        run: npm ci

      - name: 代码检查
        run: npm run lint

      - name: 运行测试
        run: npm test

      - name: 构建
        run: npm run build

Read the full file on GitHub · 144 lines

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. 9d ago First seen · 144 lines · 57 tokens per session scan A b0e639948cdc

Subscribe to this mod's changes

github-actions-gen is a skill published in the GitHub repository laolaoshiren/claude-code-skills-zh (823 stars, last pushed 2d ago), licensed MIT. It adds 57 tokens to every session and 1,910 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. 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

review-tooling

Detect what dev tooling infrastructure a project has and flag gaps across linters, formatters, pre-commit hooks, test runners, and CI/CD pipelines. Returns structured findings without applying changes. Use when the user asks to "review tooling", "check project tooling", "what tooling is missing", "review dev…

tobihagemann/turbo · 74 tokens

devops

Deployment and infrastructure operations. Use when writing or debugging a Dockerfile, docker build/run, docker compose; running terraform plan/apply/destroy or editing .tf files and modules; using kubectl, debugging pods (CrashLoopBackOff, ImagePullBackOff, OOMKilled), applying manifests, or writing Helm charts…

vanducng/skills · 167 tokens

Prompt Version Control Workflow

Sets up a prompt versioning system with naming conventions, diff tracking, A/B evaluation gates before promotion, and rollback triggers.

Notysoty/openagentskills · 30 tokens

investigate-ci

Investigates GitHub Actions workflow failures for any repo. Fetches recent runs, identifies failures, extracts error logs, diagnoses root causes, and suggests fixes. Use when a deploy or CI workflow fails and you need to understand why.

mostafa-drz/claude-skills · 50 tokens

ci-cd-quality-gates

Design lightweight CI quality gates—lint, test tiers, security scans, and merge policies. Use when setting up or improving pipelines without tying to one stack only.

charlieviettq/awesome-agent-skill · 39 tokens

postmortem-solo

Run a lightweight, blame-free postmortem after an incident, failed launch, or missed deadline — for one person. Use when the user says "that didn't go well", "the launch flopped", "we had an outage", "I missed my deadline", or wants to learn from a recent failure.

rockscy/solo-skills · 68 tokens