---
name: "github-actions-concurrency-cancel"
description: "Cancel outdated CI builds immediately when new commits are pushed to the same pull request."
metadata:
  author: "Actions"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "cancel outdated github actions runs"
  - "configure gha concurrency group"
  - "prevent parallel deployments gha"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# GitHub Actions Concurrency Groups & Redundant Run Canceling

Configures concurrency in GitHub Actions: defining concurrency groups (${{ github.workflow }}-${{ github.ref }}), setting cancel-in-progress: true, preventing build runner congestion, and locking production deployment jobs.

## When to Invoke
Invoke this skill whenever you need to:
- cancel outdated github actions runs
- configure gha concurrency group
- prevent parallel deployments gha

## Execution SOP & Rules
1. Add top-level concurrency block: concurrency: group: ${{ github.workflow }}-${{ github.ref }}.
2. Set cancel-in-progress: true to terminate stale running workflows instantly upon newer push events.
3. On production deployment workflows, omit cancel-in-progress or set to false to prevent aborting active deploys.
4. Verify older workflow runs show status 'Cancelled' in the GitHub Actions dashboard.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
