Agent skill

GitHub Actions Gen

by laolaoshiren in laolaoshiren/claude-code-skills-zh

分析真实项目并生成或修订安全、可验证的 GitHub Actions workflow;当用户要求创建 CI、测试矩阵、构建、Release、部署、缓存、Secrets、OIDC、PR 自动化或排查 workflow 配置时使用

MITAuto-check: notesDevOps & Cloud

Install GitHub Actions Gen

skills CLI
$ npx skills add laolaoshiren/claude-code-skills-zh --skill github-actions-gen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install laolaoshiren/claude-code-skills-zh github-actions-gen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/laolaoshiren/claude-code-skills-zh.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/github-actions-gen .claude/skills/github-actions-gen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
github-actions-gen
GitHub stars
878
Token cost
~1.1k tokens
SKILL.md length
298 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

分析真实项目并生成或修订安全、可验证的 GitHub Actions workflow;当用户要求创建 CI、测试矩阵、构建、Release、部署、缓存、Secrets、OIDC、PR 自动化或排查 workflow 配置时使用

  • Works in 7 steps: 盘点项目证据 → 建立威胁模型 → 设计最小流水线 → …
  • Tasks that involve CI/CD
  • SKILL.md covers 核心原则, 工作流程, 交付格式 and 质量检查清单
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

GitHub Actions Gen is an agent skill from laolaoshiren/claude-code-skills-zh. 分析真实项目并生成或修订安全、可验证的 GitHub Actions workflow;当用户要求创建 CI、测试矩阵、构建、Release、部署、缓存、Secrets、OIDC、PR 自动化或排查 workflow 配置时使用

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering CI/CD and OAuth and OpenID Connect. It works with GitHub Actions and GitHub. The repository describes itself as: 面向中文开发者的 Claude Code Skills / Agents / Plugins 精选与原创技能库|按场景分类|复制即装|持续更新. The licence is MIT.

When your agent uses it

  • Tasks that involve CI/CD
  • Tasks that involve OAuth and OpenID Connect

Example prompts

  • “/github-actions-gen”

Requirements

  • Node.js

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. 盘点项目证据
  2. 建立威胁模型
  3. 设计最小流水线
  4. 核验并固定 Action
  5. 生成 workflow
  6. 单独保护发布与部署
  7. 验证

What it can do on your machine

Read from SKILL.md and the folder at commit 633f21c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

GitHub Actions Gen loads about 1.1k tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 298 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:119
    - 查看最终 diff,确认没有写入 Token、账号、真实 webhook、`.env` 或无关配置。

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from laolaoshiren/claude-code-skills-zh at commit 633f21c, republished under its MIT licence (© laolaoshiren). 298 words, ~1,064 tokens.

Download SKILL.mdSave it as .claude/skills/github-actions-gen/SKILL.md (or your agent's skills folder).
name
github-actions-gen
description
分析真实项目并生成或修订安全、可验证的 GitHub Actions workflow;当用户要求创建 CI、测试矩阵、构建、Release、部署、缓存、Secrets、OIDC、PR 自动化或排查 workflow 配置时使用

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 设置最小 permissions 和 timeout-minutes;不依赖仓库默认权限。
  • 生成后运行真实语法与项目命令验证,不把“配置看起来正确”当作通过。

工作流程

1. 盘点项目证据
  • 读取 manifest、lockfile、wrapper、运行时文件和现有 workflow,例如 package.json、.nvmrc、pyproject.toml、go.mod、Cargo.toml、Dockerfile 与 .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

下面示例假设项目已有 .nvmrc、package-lock.json、lint、test 和 build 脚本:

yaml
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

不要机械复制示例。若项目使用 pnpm、Yarn、uv、Poetry、Gradle、Go 或 Rust,应使用其真实锁文件、wrapper 和命令。

6. 单独保护发布与部署
  • 把发布 / 部署放入独立 job,只给该 job 必需的 contents: write、packages: write 或 id-token: write。
  • 优先使用短期 OIDC,避免长期云密钥;限制云端 audience、subject、分支、仓库和 Environment。
  • 为 production 使用 required reviewers、受保护 Environment、并发锁和可验证回滚。
  • 对 workflow_dispatch 输入设置类型、选项和默认值;在执行前再次校验目标环境与版本。
  • 发布前验证产物来源,必要时生成 attestations / provenance;不要部署来自未验证 PR 的 Artifact。
7. 验证
  • 运行 actionlint;若工具不可用,明确说明未完成该门禁,不要声称语法通过。
  • 运行 YAML 解析检查,并核对所有 ${{ }}、shell、路径、矩阵和 needs 引用。
  • 在本地执行 workflow 中引用的 lint、test、build 命令,或说明环境限制。
  • 搜索所有 uses:,确认第三方 Action 都是完整 SHA;检查 checkout 的 persist-credentials。
  • 用 fork PR、内部 PR、push、tag、手动部署等场景检查 Secrets 与权限是否符合预期。
  • 查看最终 diff,确认没有写入 Token、账号、真实 webhook、.env 或无关配置。

交付格式

用中文说明:

  1. 新增或修改的 workflow 及触发条件;
  2. 每个 job 的权限、Secrets / OIDC 和 Environment 边界;
  3. Action SHA 的版本来源与核验时间;
  4. 已运行的验证、结果和未覆盖项;
  5. 发布 / 部署的人工确认点与回滚方式。

除非用户明确要求,不额外创建 README-CICD.md 等辅助文档。

质量检查清单

  • 命令、运行时和 lockfile 来自真实项目证据
  • 所有 Action 使用完整 40 位 SHA 和版本注释
  • checkout 默认 persist-credentials: false
  • workflow / job 权限最小化并设置超时
  • fork PR 不接触 Secrets、写权限或高权限 Runner
  • pull_request_target 不执行不可信 PR 内容
  • 不可信上下文未直接拼入 shell
  • Release / 部署经过明确授权和 Environment 保护
  • actionlint 与项目命令验证已完成或如实记录缺口

© laolaoshiren, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/github-actions-gen of laolaoshiren/claude-code-skills-zh.

Open the folder on GitHubat commit 633f21c

Compare with similar skills

GitHub Actions Gen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

GitHub Actions Gen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
GitHub Actions Gen this skilllaolaoshiren/claude-code-skills-zh878—~1.1kAutomated safety check: NotesMIT
GitHub Actions Docsdevantler-tech/ksail1652 repos~1.3kAutomated safety check: PassCustom licence
Releasing Reactivepropertyrunceel/ReactiveProperty944—~2.7kAutomated safety check: PassMIT
AWS GitHub Oidc Scoped Rolemizchi/skills356—~1.6kAutomated safety check: PassNone
Gh Actions Validatorjeremylongshore/tons-of-skills-marketplace2.8k—~713Automated safety check: PassMIT
GitHub Actions Hardeninggithub/awesome-copilot40k1 repos~2.4kAutomated safety check: PassMIT

Similar skills

  • GitHub Actions Docs

    devantler-tech/ksail

    A skill your agent uses when users ask how to write, explain, customize, migrate, secure, or troubleshoot GitHub Actions workflows, workflow syntax, triggers, matrices, runners, reusable workflows…

    165 GitHub starsUsed in 2 repos~1.3k tokens
    DevOps & CloudAuto-check passed
  • Releasing Reactiveproperty

    runceel/ReactiveProperty

    Release the ReactiveProperty NuGet package set from this repository.

    944 GitHub stars~2.7k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • OpenTofu/Terraform pattern for GitHub Actions OIDC trust with AWS IAM.

    356 GitHub stars~1.6k tokensUpdated 6 days ago
    DevOps & CloudAuto-check passed
  • Gh Actions Validator

    jeremylongshore/tons-of-skills-marketplace

    Validate use when validating GitHub Actions workflows for Google Cloud and Vertex AI deployments.

    2.8k GitHub stars~713 tokensUpdated today
    DevOps & CloudAuto-check passed
  • GitHub Actions Hardening

    github/awesome-copilot

    Official

    Security hardening reviewer for GitHub Actions workflow files (.github/workflows/.yml).

    40k GitHub starsUsed in 1 repo~2.4k tokens
    DevOps & CloudAuto-check passed
  • Nuget Trusted Publishing

    rodri-oliveira-dev/Dapper-FluentMap

    Review, maintain, or set up NuGet trusted publishing (OIDC) for GitHub Actions.

    453 GitHub stars~1.3k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed

More from laolaoshiren/claude-code-skills-zh

All 19 skills in this repo
  • API Tester

    laolaoshiren/claude-code-skills-zh

    依据真实 OpenAPI、路由实现和现有测试生成并验证 API 测试。用于用户要求测试接口、补集成测试、验证 API 契约、生成回归用例或排查接口兼容性时;区分“生成测试”和“执行请求”的授权,不猜测状态码、响应结构或 SLA,不在未确认环境中发送写请求。

    878 GitHub stars~614 tokensUpdated 3 days ago
    Auto-check passed
  • Dep Auditor

    laolaoshiren/claude-code-skills-zh

    审计 Node.js、Python、Go、Rust、JVM、Ruby 项目的依赖漏洞、版本健康度与许可证事实;当用户要求检查 package.json、lockfile、requirements、go.mod、Cargo.toml、pom.xml、Gemfile.lock,或生成不改依赖的中文审计报告时使用

    878 GitHub stars~895 tokensUpdated 3 days ago
    Auto-check passed
  • Eslint Fix

    laolaoshiren/claude-code-skills-zh

    安全诊断并修复 ESLint error、warning 和配置兼容问题。用于用户要求运行 lint、解释 ESLint 报错、限定范围自动修复或迁移 ESLint 配置时;优先使用项目锁定的包管理器与版本,先预检再修改,不自动下载最新版或批量改写无关源码。

    878 GitHub stars~436 tokensUpdated 3 days ago
    Auto-check passed
  • Git Workflow

    laolaoshiren/claude-code-skills-zh

    安全处理 Git 状态检查、提交信息、commit、分支、push、PR 和 rebase。用于用户要求检查改动、生成或创建提交、管理分支、推送、发起 PR 或整理历史时;严格区分每个动作的授权,并保护工作树中已有和无关的修改。

    878 GitHub stars~513 tokensUpdated 3 days ago
    Auto-check passed
  • Skill Curator

    laolaoshiren/claude-code-skills-zh

    中文 Skill 收录评估器。用于核验 GitHub 上的 Claude Code、Codex、Agent Skills、Plugin、MCP、CLI 或 Agent 工作流是否值得加入精选列表;检查真实资产、安装方式、活跃度、重复项和安全边界,并生成分类、中文描述与可追溯证据。

    878 GitHub stars~756 tokensUpdated 3 days ago
    Auto-check passed
  • Zh Readme

    laolaoshiren/claude-code-skills-zh

    中文 README 生成器 - 先分析项目,再生成面向中文开发者的高质量 README. An agent skill from laolaoshiren/claude-code-skills-zh.

    878 GitHub stars~477 tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about GitHub Actions Gen

What does GitHub Actions Gen do?

分析真实项目并生成或修订安全、可验证的 GitHub Actions workflow;当用户要求创建 CI、测试矩阵、构建、Release、部署、缓存、Secrets、OIDC、PR 自动化或排查 workflow 配置时使用. GitHub Actions Gen is an agent skill from laolaoshiren/claude-code-skills-zh.

When should I use GitHub Actions Gen?

GitHub Actions Gen fits situations like: tasks that involve CI/CD; tasks that involve OAuth and OpenID Connect.

How do I install GitHub Actions Gen in Claude Code?

Run `npx skills add laolaoshiren/claude-code-skills-zh --skill github-actions-gen -a claude-code`. Or copy the skill folder (skills/github-actions-gen in laolaoshiren/claude-code-skills-zh) into .claude/skills/github-actions-gen in your project. Claude Code loads it when a task matches its description.

How do I install GitHub Actions Gen in Codex?

Run `npx skills add laolaoshiren/claude-code-skills-zh --skill github-actions-gen -a codex`. Or copy the skill folder (skills/github-actions-gen in laolaoshiren/claude-code-skills-zh) into .agents/skills/github-actions-gen in your project. Codex loads it when a task matches its description.

Can I use GitHub Actions Gen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add laolaoshiren/claude-code-skills-zh --skill github-actions-gen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/github-actions-gen, .gemini/skills/github-actions-gen, .github/skills/github-actions-gen and .opencode/skills/github-actions-gen in your project.

What does GitHub Actions Gen need to run?

SKILL.md names no scripts, command-line tools or credentials: GitHub Actions Gen is instructions for the agent only. Our summary lists: Node.js.

Does GitHub Actions Gen access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is GitHub Actions Gen safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does GitHub Actions Gen use?

GitHub Actions Gen is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does GitHub Actions Gen use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to GitHub Actions Gen?

Skills that share tags, products or a category with GitHub Actions Gen: GitHub Actions Docs (devantler-tech/ksail, 165 stars), Releasing Reactiveproperty (runceel/ReactiveProperty, 944 stars), AWS GitHub Oidc Scoped Role (mizchi/skills, 356 stars) and Gh Actions Validator (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains GitHub Actions Gen?

laolaoshiren (a GitHub user) maintains it in laolaoshiren/claude-code-skills-zh, which has 878 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 5, 2026.

Source: laolaoshiren/claude-code-skills-zh on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.