← 返回 Skill 列表
extension
分类: 开发与工程API Key 暂未确认

actions-optimiser

当用户要求“优化GitHub Actions”、“改进我的工作流程”、“让操作变得更好”、“审查工作流程使用情况”、“其他人是如何使用这个操作的”、“查找GitHub Actions的最佳实践”,或者想要收集关于如何使用GitHub Actions来改进他们工作流程的实际案例时,应该使用此技能。

person作者: jakexiaohubgithub

GitHub Actions Optimiser

Mine real-world usage of a specific GitHub Action across public repos to inform optimisations to a workflow file.

The technique

When a workflow uses an action like uses: hashicorp/setup-terraform@v3, search public repos for working examples and decode them in parallel:

1. Find candidate workflows

gh search code "setup-terraform path:.github/workflows" --limit 20

2. Pull at least 5 in parallel and decode

The contents API returns base64-encoded YAML — decode in one pipeline:

gh api repos/Sofiane-Truman/cloud-foundation-fabric/contents/.github/workflows/linting.yml \
  | jq -r '.content' | base64 -d

Run several of these concurrently (one per candidate repo) so a survey takes one round-trip, not five.

3. Identify patterns worth borrowing

Look for: non-default inputs that recur across repos, caching setups, matrix patterns, version pins, permissions blocks, conditional steps. Single-occurrence quirks are noise; patterns repeated across 3+ unrelated repos are signal.

4. Apply

Edit the user's workflow file to incorporate the patterns. Cite the source repo for any non-trivial change so the user can verify context.