github-actions-efficiency

Audit GitHub Actions workflows and recommend fixes to reduce CI minutes and costs.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill github-actions-efficiency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-actions-efficiency
Source: https://github.com/github/awesome-copilot/tree/main/skills/github-actions-efficiency
Command: npx skills add https://github.com/github/awesome-copilot --skill github-actions-efficiency

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

GitHub Actions workflows often waste CI minutes through missing dependency caches, absent concurrency cancellation, over-broad triggers, and bloated test matrices. This Skill audits your workflows, identifies the top waste sources, and recommends evidence-backed fixes that reduce CI spend without hiding required validation.

Core Features & Use Cases

  • Workflow Auditing: Measures current usage with gh run list and ripgrep scans of .github/workflows/ to find missing caches, missing concurrency cancellation, and duplicate coverage.
  • Guardrailed Fix Selection: Applies five safety rules before recommending changes, then ranks up to three fixes by estimated daily CI minutes saved.
  • Live Validation: Verifies path-gating and concurrency cancellation with real test pushes when gh CLI access is available, and clearly labels static-only analysis when it is not.
  • Use Case: A team notices their CI bill climbing. The Skill inspects their workflows, finds no dependency caching and a full test matrix running on every docs change, then proposes caching with lockfile keys, concurrency cancellation, and matrix reduction with measured before/after impact.

Quick Start

Audit the GitHub Actions workflows in this repository and recommend the top fixes to reduce CI minutes and cost.

Frequently Asked Questions about github-actions-efficiency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce GitHub Actions CI costs?

Start by auditing workflows for missing dependency caches, missing concurrency cancellation, over-broad triggers, and duplicate coverage. Then apply the highest-impact fixes first, ranked by estimated daily CI minutes saved, and validate changes with live test runs.

How to add dependency caching to a GitHub Actions workflow?

Use actions/cache@v4 with a key based on your lockfile, such as hashFiles('**/package-lock.json'), and a restore-keys fallback prefix. Adapt the cache path and invalidation file to match your repository's package ecosystem.

Can I audit GitHub Actions workflows without gh CLI access?

Yes, you can paste the contents of .github/workflows/ and recent run output for a static-only analysis. The results are labeled as not confirmed with live runs, and some insights may be incomplete without full repository access.

When should I reduce the test matrix in GitHub Actions?

Match matrix breadth to the decision being made: full matrix for releases, a reduced compatibility matrix for runtime or packaging changes, and a single representative leg for ordinary code changes. Drop only matrix legs with no explicit version or platform commitment.

Why is concurrency cancellation important in CI workflows?

Without a concurrency group and cancel-in-progress, every new push leaves stale runs consuming runner minutes. Adding a concurrency block keyed on workflow and ref cancels outdated runs automatically, cutting wasted spend on superseded commits.