Setup
On first activation, read setup.md to align auto-activation rules, repo shape, and mutation boundaries before editing workflows or triggering runs.
When to Use
User needs GitHub Actions workflow design, debugging, hardening, release orchestration, runner strategy, matrix tuning, cache fixes, or reusable workflow architecture.
Use this skill when the result depends on GitHub Actions semantics and GitHub delivery controls, not generic CI advice.
Architecture
Memory lives in ~/github-actions/. See memory-template.md for the baseline structure.
CODEBLOCK0
Quick Reference
Load only the file needed for the current workflow problem.
| Topic | File |
|---|
| Setup and activation behavior | INLINECODE3 |
| Memory schema and status model |
memory-template.md |
| Authoring patterns and reusable workflow shapes |
workflow-patterns.md |
| Permissions, secrets, OIDC, and fork safety |
security-model.md |
| Run failure triage and log-first debugging |
debugging-playbook.md |
| Tag, release, and deployment orchestration |
release-patterns.md |
| Caching, matrices, path filters, and runner efficiency |
performance-tuning.md |
Requirements
- - Optional but high leverage tools:
gh, jq, INLINECODE12 - GitHub repository access if the user wants live run inspection or workflow changes
- Deployment credentials only through GitHub-managed secrets, environments, or OIDC
Never ask the user to paste personal access tokens, cloud keys, or private signing material into chat.
CI/CD Examples
YAML snippets in this skill are examples for repository workflow files.
References like ${{ github.* }}, ${{ inputs.* }}, ${{ vars.* }}, and ${{ secrets.* }} belong to GitHub Actions runtime, not to the agent runtime.
The agent should design around those placeholders but should not expect to read their values directly.
Operating Coverage
This skill covers GitHub Actions as an operating system for delivery:
- - workflow authoring across
push, pull_request, workflow_dispatch, schedule, and INLINECODE21 - job design across permissions, concurrency, matrices, artifacts, caches, services, and environments
- release and deployment pipelines with protected branches, approvals, tags, and rollback checkpoints
- incident response for flaky runs, missing artifacts, cache corruption, and environment drift
Data Storage
Local notes in ~/github-actions/ may include:
- - repo topology, protected branches, and environment names
- known-good workflow defaults and reusable workflow contracts
- recurring incident signatures with fixes and prevention notes
- release gates, promotion steps, and rollback constraints
Core Rules
1. Start from Trigger, Target, and Artifact Contract
Before editing YAML, define:
- - the event that should start the workflow
- the branch, tag, or environment it may affect
- the artifact or status each job must produce
Without that contract, workflows turn into step collections with unclear release behavior.
2. Default to Explicit Permissions and Narrow Blast Radius
Declare
permissions: at workflow or job level and grant only what that job needs.
Treat
contents: write,
packages: write, and
id-token: write as exceptions that need a clear reason.
3. Separate Validation, Build, Release, and Deploy Concerns
Keep pull request validation, artifact creation, release publishing, and production deployment as distinct responsibilities.
Use
workflow_call or small reusable jobs instead of one oversized workflow that does everything.
4. Bound Every Run with Concurrency, Timeouts, and Filters
Use
concurrency for branch or environment scoped cancellation, add
timeout-minutes, and filter noisy events with branch or path rules.
Minutes disappear quickly when redundant runs are left unbounded.
5. Optimize Deterministic Work, Not Random Side Effects
Cache package manager state, toolchains, and stable build outputs keyed by lockfiles or explicit versions.
Use artifacts for job handoffs. Do not cache paths that depend on secrets, timestamps, or mutable deploy state.
6. Debug from Logs and Reproduction Evidence
Classify failures before rewriting workflows:
- - trigger and condition mismatch
- missing dependency or toolchain drift
- credential or permission denial
- artifact or path contract break
- flaky external dependency
Fix the failure mode that exists, not the one that feels familiar.
7. Prefer Short-Lived Credentials and Protected Deploy Surfaces
Use GitHub environments, reviewer gates, and OIDC federation where possible.
Avoid long-lived cloud secrets, unreviewed
workflow_dispatch deploys, and production writes from untrusted events.
GitHub Actions Traps
- - Mixing pull request validation and production deployment in one unguarded workflow -> accidental releases from the wrong event.
- Granting broad permissions to every job -> larger blast radius when one action or step is compromised.
- Using caches without lockfile or version keys -> stale dependencies and confusing non-reproducible failures.
- Letting matrices expand without cost controls -> excessive minutes and noisy failures that hide the real signal.
- Depending on
ubuntu-latest quirks without version pinning -> sudden toolchain drift after runner image updates. - Rebuilding instead of promoting the tested artifact -> release mismatch between validated code and shipped code.
- Treating reruns as the fix -> root cause remains and the incident repeats.
External Endpoints
| Endpoint | Data Sent | Purpose |
|---|
| https://github.com | repository metadata, git refs, workflow files, run pages, and artifact access | GitHub repository and Actions UI workflows |
| https://api.github.com |
workflow, run, check, release, and repository API payloads | API-driven Actions inspection and control |
| Cloud or deployment endpoints explicitly configured by the workflow | deployment payloads, build artifacts, and short-lived auth tokens | Release and deploy steps after user approval |
No other data should be sent externally unless the workflow itself is configured to call additional services.
Security & Privacy
Data that leaves your machine:
- - GitHub repository and Actions traffic when the user requests live inspection or workflow changes
- deployment traffic only to user-approved targets configured in the workflow
Data that stays local:
- - operating notes under INLINECODE32
- workflow drafts, incident analysis, and release policies prepared locally
This skill does NOT:
- - ask for raw personal access tokens or cloud secrets in chat
- recommend bypassing branch protection or approval gates
- hide undeclared outbound integrations
- modify its own INLINECODE33
Trust
This skill depends on GitHub and any deployment systems the user explicitly connects to their workflows.
Only install and run it if you trust those systems with your repository and release data.
Scope
This skill ONLY:
- - designs, reviews, and improves GitHub Actions workflows
- debugs workflow runs with log-driven reasoning and stable reproduction steps
- structures safe release and deployment automation
This skill NEVER:
- - assume write access to repositories or environments without confirmation
- suggest secret exfiltration, masking bypasses, or hidden credential handling
- normalize production deployment from untrusted pull request contexts
Related Skills
Install with
clawhub install <slug> if user confirms:
- -
ci-cd - Choose CI and deployment strategy before locking into one platform. - INLINECODE36 - Tighten branch, tag, and history handling around workflow events.
- INLINECODE37 - Design multi-step execution systems with clearer ownership and gating.
- INLINECODE38 - Connect delivery pipelines to infrastructure and operational guardrails.
- INLINECODE39 - Improve container build, cache, and registry steps inside Actions workflows.
Feedback
- - If useful: INLINECODE40
- Stay updated: INLINECODE41
设置
首次激活时,请先阅读 setup.md,以对齐自动激活规则、仓库形态和变更边界,然后再编辑工作流或触发运行。
使用时机
用户需要 GitHub Actions 工作流设计、调试、加固、发布编排、运行器策略、矩阵调优、缓存修复或可复用工作流架构时使用。
当结果依赖于 GitHub Actions 语义和 GitHub 交付控制,而非通用 CI 建议时,使用此技能。
架构
记忆文件存放在 ~/github-actions/ 目录下。基础结构请参考 memory-template.md。
text
~/github-actions/
|-- memory.md # 持久化的仓库上下文和激活边界
|-- repo-map.md # 仓库、分支、包管理器和部署目标
|-- workflow-defaults.md # 触发器、权限、缓存和运行器的稳定默认配置
|-- incidents.md # 故障特征、根本原因和修复方案
-- release-rules.md # 发布门禁、审批和回滚说明
快速参考
仅加载当前工作流问题所需的文件。
| 主题 | 文件 |
|---|
| 设置和激活行为 | setup.md |
| 记忆模式和状态模型 |
memory-template.md |
| 编写模式和可复用工作流形态 | workflow-patterns.md |
| 权限、密钥、OIDC 和 Fork 安全 | security-model.md |
| 运行故障排查和日志优先调试 | debugging-playbook.md |
| 标签、发布和部署编排 | release-patterns.md |
| 缓存、矩阵、路径过滤器和运行器效率 | performance-tuning.md |
要求
- - 可选但高杠杆工具:gh、jq、act
- 如果用户希望实时检查运行或修改工作流,需要 GitHub 仓库访问权限
- 部署凭证仅通过 GitHub 管理的密钥、环境或 OIDC 提供
切勿要求用户在聊天中粘贴个人访问令牌、云密钥或私有签名材料。
CI/CD 示例
本技能中的 YAML 片段是仓库工作流文件的示例。
类似 ${{ github. }}、${{ inputs. }}、${{ vars. }} 和 ${{ secrets. }} 的引用属于 GitHub Actions 运行时,而非代理运行时。
代理应围绕这些占位符进行设计,但不应期望直接读取它们的值。
操作覆盖范围
本技能将 GitHub Actions 视为一个交付操作系统:
- - 跨 push、pullrequest、workflowdispatch、schedule 和 workflow_call 的工作流编写
- 跨权限、并发、矩阵、制品、缓存、服务和环境的作业设计
- 包含保护分支、审批、标签和回滚检查点的发布和部署流水线
- 针对不稳定运行、缺失制品、缓存损坏和环境漂移的事件响应
数据存储
~/github-actions/ 中的本地笔记可能包括:
- - 仓库拓扑、保护分支和环境名称
- 经过验证的工作流默认配置和可复用工作流契约
- 带有修复方案和预防说明的重复事件特征
- 发布门禁、升级步骤和回滚约束
核心规则
1. 从触发器、目标和制品契约开始
在编辑 YAML 之前,定义:
- - 应启动工作流的事件
- 可能受其影响的分支、标签或环境
- 每个作业必须产生的制品或状态
没有这个契约,工作流就会变成一系列步骤的集合,发布行为不明确。
2. 默认使用显式权限并缩小影响范围
在工作流或作业级别声明 permissions:,仅授予该作业所需的权限。
将 contents: write、packages: write 和 id-token: write 视为需要明确理由的例外情况。
3. 分离验证、构建、发布和部署的关注点
将拉取请求验证、制品创建、发布发布和生产部署视为不同的职责。
使用 workflow_call 或小型可复用作业,而不是一个包罗万象的巨型工作流。
4. 使用并发、超时和过滤器约束每次运行
使用 concurrency 进行分支或环境范围的取消,添加 timeout-minutes,并使用分支或路径规则过滤噪音事件。
当冗余运行不受约束时,分钟数会迅速消耗。
5. 优化确定性工作,而非随机副作用
缓存包管理器状态、工具链和稳定的构建输出,以锁定文件或显式版本为键。
使用制品进行作业交接。不要缓存依赖于密钥、时间戳或可变部署状态的路径。
6. 从日志和复现证据进行调试
在重写工作流之前对故障进行分类:
- - 触发器和条件不匹配
- 缺少依赖项或工具链漂移
- 凭证或权限拒绝
- 制品或路径契约破坏
- 不稳定的外部依赖
修复实际存在的故障模式,而不是感觉熟悉的那个。
7. 优先使用短期凭证和保护性部署面
尽可能使用 GitHub 环境、审查者门禁和 OIDC 联合。
避免长期存在的云密钥、未经审查的 workflow_dispatch 部署以及来自不可信事件的生产写入。
GitHub Actions 陷阱
- - 在同一个无防护的工作流中混合拉取请求验证和生产部署 -> 从错误的事件导致意外发布。
- 为每个作业授予广泛权限 -> 当一个操作或步骤被攻破时,影响范围更大。
- 使用没有锁定文件或版本键的缓存 -> 过时的依赖和令人困惑的不可复现故障。
- 让矩阵无成本控制地扩展 -> 过多的分钟数和嘈杂的故障,掩盖了真正的信号。
- 依赖 ubuntu-latest 的特性而不固定版本 -> 运行器镜像更新后突然出现工具链漂移。
- 重新构建而不是升级经过测试的制品 -> 验证代码和发布代码之间的发布不匹配。
- 将重新运行视为修复方案 -> 根本原因仍然存在,事件重复发生。
外部端点
| 端点 | 发送的数据 | 目的 |
|---|
| https://github.com | 仓库元数据、git 引用、工作流文件、运行页面和制品访问 | GitHub 仓库和 Actions UI 工作流 |
| https://api.github.com |
工作流、运行、检查、发布和仓库 API 负载 | 基于 API 的 Actions 检查和控制 |
| 工作流显式配置的云或部署端点 | 部署负载、构建制品和短期认证令牌 | 用户批准后的发布和部署步骤 |
除非工作流本身配置为调用其他服务,否则不应将其他数据发送到外部。
安全与隐私
离开您机器的数据:
- - 当用户请求实时检查或工作流更改时的 GitHub 仓库和 Actions 流量
- 仅发送到工作流中配置的用户批准目标的部署流量
保留在本地数据:
- - ~/github-actions/ 下的操作笔记
- 本地准备的工作流草稿、事件分析和发布策略
此技能不会:
- - 在聊天中索要原始个人访问令牌或云密钥
- 建议绕过分支保护或审批门禁
- 隐藏未声明的出站集成
- 修改其自身的 SKILL.md
信任
此技能依赖于 GitHub 以及用户显式连接到其工作流的任何部署系统。
仅当您信任这些系统处理您的仓库和发布数据时,才安装和运行它。
范围
此技能仅:
- - 设计、审查和改进 GitHub Actions 工作流
- 使用日志驱动推理和稳定的复现步骤调试工作流运行
- 构建安全的发布和部署自动化
此技能绝不:
- - 在未经确认的情况下假设对仓库或环境的写入权限
- 建议密钥泄露、绕过掩码或隐藏的凭证处理
- 将来自不可信拉取请求上下文的生产部署正常化
相关技能
如果用户确认,使用 clawhub install
安装:
- - ci-cd - 在锁定到一个平台之前,选择 CI 和部署策略。
- git - 围绕工作流事件收紧分支、标签和历史处理。
- workflow - 设计具有更清晰所有权和门禁的多步骤执行系统。
- devops - 将交付流水线连接到基础设施和运营护栏。
- docker - 改进 Actions 工作流中的容器构建、缓存和注册表步骤。
反馈
- - 如果有用:clawhub star github-actions
- 保持更新:clawhub sync