github-actions-gen

Featured

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

AI & Automation 686 stars 69 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
94
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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. 核验并固定...

Details

Author
laolaoshiren
Repository
laolaoshiren/claude-code-skills-zh
Created
3 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

git-workflow

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

686 Updated 2 days ago
laolaoshiren
Code & Development Listed

github-actions-ci

GitHub Actions CI/CD patterns covering workflow anatomy, trigger strategies, caching, matrix builds, security hardening, reusable workflows, and pipeline debugging. Use this skill whenever writing or editing .github/workflows/*.yml files, debugging a failed CI run, setting up CI for a new repository, optimizing slow or flaky pipelines, or implementing release automation — even for small edits, since YAML structure and security pitfalls are easy to introduce silently.

0 Updated yesterday
sardonyx0827
Code & Development Listed

github-actions

Write, review, and harden GitHub Actions workflows against supply-chain attacks, and bump a whole fleet of repos' action pins to the latest versions. Use when writing or editing a workflow YAML (.github/workflows/*.yml, ci.yml), when asked to review a CI workflow or audit GitHub Actions security, when the ci-action-ref-reminder hook fires, or when the user wants to "bump my actions", "update the fleet", "pin actions to SHAs", run zizmor, or close supply-chain / pull_request_target / script-injection / GITHUB_TOKEN-permissions gaps. Pairs with references/security-checklist.md (the full checklist) and dev-env-setup's CI templates.

0 Updated yesterday
mickzijdel