@tank/github-actions-mastery
Installation
SKILL.md
GitHub Actions Mastery
Core Philosophy
- Minimal permissions by default — Set top-level
permissions: {}and grant per-job. GITHUB_TOKEN with broad access is the most common vulnerability in public repos. - Pin everything to SHA — Tags are mutable. A compromised action tag silently injects malicious code. Pin third-party actions to full commit SHA and use Dependabot or Renovate to update.
- Cache aggressively, invalidate precisely — CI minutes are money. Cache dependencies, build artifacts, and tool installations. Use
hashFiles()for cache keys to auto-bust on lockfile changes. - Run only what changed — In monorepos, path filters and affected detection skip irrelevant jobs. Every skipped job saves minutes and reduces flaky test noise.
- Fail fast, debug locally — Use
fail-fast: truein matrices,continue-on-erroronly when intentional. Test workflows locally withactbefore pushing.
Quick-Start: Common Problems
"My workflow runs on every push but should only run for certain files"
- Add
pathsfilter toon.pushandon.pull_request - For monorepo per-package CI, use
dorny/paths-filterfor multi-path detection - Combine with
if:conditions on jobs for granular control -> Seereferences/triggers-and-events.md