github-actions-prevent-waste
Reduce wasted GitHub Actions PR checks with stable concurrency keys, cancellation of superseded runs, and job-level draft guards.
소스 정보
- 저장소
- stablyai/skills
- 최근 소스 활동
- 2026년 10월 16일 21:26
- 감지된 SKILL.md 언어
- 영어
- 스타
- 5
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SKILL.md 표시 중
SKILL.md
소스 지침 · 읽기 전용 미리보기- name
- github-actions-prevent-waste
- description
- Reduce wasted GitHub Actions PR checks with stable concurrency keys, cancellation of superseded runs, and job-level draft guards.
# Prevent wasted GitHub Actions runs
For PR checks, cancel superseded runs and skip jobs while the PR is a draft:
```yaml
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
```
- Keep keys stable across commits: use a unique workflow prefix and PR number or ref, never a commit SHA or run ID. Reusable workflows inherit the caller's `github.workflow`; keep caller and callee concurrency keys distinct.
- Add `github.event.pull_request.draft != true` to each check job's existing `if`, including reusable-workflow callers and aggregate jobs. Job guards prevent runner allocation; step guards still allocate runners.
- Preserve existing triggers when adding `ready_for_review` and `converted_to_draft`. The former starts checks when review begins; the latter lets a replacement run cancel old work before its jobs skip.
- Concurrency cancellation needs a new run in the same group. If path filters prevent that run, use a trusted cleanup workflow on PR updates to cancel only older heads, rechecking the current head before cancellation. Never check out PR code in privileged cleanup.
References: [concurrency](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency), [PR events](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request).
GitHub에서 보기