Install
openclaw skills install github-actions-optimizerOptimize GitHub Actions workflows for speed, cost, security, and reliability — analyze run times, cache strategies, job parallelism, and runner selection.
openclaw skills install github-actions-optimizerAnalyze and optimize GitHub Actions workflows for faster builds, lower costs, better security, and higher reliability. Reviews workflow files, run history, cache usage, and runner configurations. Use when CI is slow, expensive, or unreliable.
"Optimize my GitHub Actions workflows"
"Why are my CI builds so slow?"
"Audit my workflows for security issues"
"Reduce GitHub Actions costs"
"Find flaky steps in my CI pipeline"
# Find all workflow files
find .github/workflows -name "*.yml" -o -name "*.yaml" 2>/dev/null
# Check recent run durations
gh run list --limit 20 --json name,status,conclusion,startedAt,updatedAt,databaseId | python3 -c "
import json, sys
from datetime import datetime
runs = json.load(sys.stdin)
for r in runs:
start = datetime.fromisoformat(r['startedAt'].rstrip('Z'))
end = datetime.fromisoformat(r['updatedAt'].rstrip('Z'))
duration = (end - start).total_seconds() / 60
print(f'{r[\"name\"]:30s} {r[\"conclusion\"]:10s} {duration:.1f}min')
"
Caching analysis:
actions/cache or actions/setup-node with cache)Job parallelism:
Runner optimization:
ubuntu-latest-xl, ubuntu-latest-16-cores)Build optimization:
fetch-depth: 0)Minute savings:
Storage savings:
@v3 instead of SHA pinningpull_request_target with checkout of PR headrun: blocks (${{ github.event.issue.title }})continue-on-error hiding real failuresRecommend modern GitHub Actions features:
## GitHub Actions Optimization Report
**Workflows:** 5 | **Avg monthly minutes:** 12,400 | **Monthly cost:** ~$99
### ⚡ Speed Improvements
1. **Add dependency caching** — ci.yml
Current: `npm ci` runs fresh every time (2m 15s)
Fix: Add `cache: 'npm'` to `actions/setup-node`
Savings: ~1m 45s per run × 180 runs/mo = 315 min/mo
2. **Parallelize test suites** — ci.yml
Current: Unit + integration + e2e run sequentially (18 min)
Fix: Split into 3 parallel jobs
Savings: ~12 min per run (runs in 6 min instead of 18)
3. **Add path filters** — ci.yml
Current: Triggers on all pushes including docs changes
Fix: `paths-ignore: ['docs/**', '*.md', 'LICENSE']`
Savings: ~40 unnecessary runs/mo × 18 min = 720 min/mo
### 🔐 Security Issues
4. **Unpinned action** — deploy.yml:12
`uses: actions/checkout@v4` → pin to SHA
5. **Script injection risk** — pr-comment.yml:8
`run: echo "${{ github.event.comment.body }}"`
→ Use environment variable instead
6. **Broad GITHUB_TOKEN** — all workflows
No `permissions:` block = read-write to everything
→ Add explicit `permissions: { contents: read }`
### 💰 Cost Savings
| Optimization | Minutes Saved/mo | $ Saved/mo |
|-------------|------------------|------------|
| Dependency cache | 315 | $2.52 |
| Path filters | 720 | $5.76 |
| Concurrency cancel | 200 | $1.60 |
| Timeout (6h → 30m) | ~0 (prevents surprise) | — |
| **Total** | **1,235** | **$9.88** |
Projected monthly: 12,400 → 11,165 min (-10%)