garrytan / garrytan/gstack

CI: cancel superseded actionlint and skill-docs runs

Open Beginner friendly
#2,046 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133k
Forks
19.9k
Avg merge
18h 46m
Merged PRs (30d)
26

Description

## Summary

Two always-on lightweight workflows run on both `push` and `pull_request` but do not declare `concurrency`, so same-repo PR branch updates can leave stale duplicate runs queued/running for the same commit series:

- `.github/workflows/actionlint.yml`
- `.github/workflows/skill-docs.yml`

The heavier workflows already use this pattern, for example:

- `.github/workflows/evals.yml` has `concurrency: group: evals-${{ github.head_ref }}` + `cancel-in-progress: true`
- `.github/workflows/windows-free-tests.yml` has `concurrency: group: windows-free-${{ github.head_ref }}` + `cancel-in-progress: true`
- `.github/workflows/make-pdf-gate.yml`, `version-gate.yml`, and `pr-title-sync.yml` also cancel superseded runs

## Evidence inspected

Repo-local files inspected:

- `README.md`
- `CONTRIBUTING.md`
- `.github/workflows/actionlint.yml`
- `.github/workflows/skill-docs.yml`
- `.github/workflows/evals.yml`
- `.github/workflows/make-pdf-gate.yml`
- `.github/workflows/pr-title-sync.yml`
- `.github/workflows/version-gate.yml`
- `.github/workflows/windows-free-tests.yml`
- `.github/workflows/windows-setup-e2e.yml`
- `.github/actionlint.yaml`
- recent merged PRs including #2004, #1990, #1966, #1951, #1929, #1916, #1912, #1911

Commands used for duplicate/evidence checks:

```bash
gh issue list -R garrytan/gstack --state open --limit 200 --json number,title,body,url
gh pr list -R garrytan/gstack --state open --limit 200 --json number,title,body,url
gh issue list -R garrytan/gstack --state open --search 'concurrency OR "cancel-in-progress" OR "duplicate workflow" OR "double run"' --limit 50 --json number,title,url
gh pr list -R garrytan/gstack --state open --search 'concurrency OR "cancel-in-progress" OR "duplicate workflow" OR "double run"' --limit 50 --json number,title,url
gh issue list -R garrytan/gstack --state open --search '"push + pull_request" "concurrency" "skill-docs" "actionlint"' --limit 20 --json number,title,url
gh pr list -R garrytan/gstack --state open --search '"push + pull_request" "concurrency" "skill-docs" "actionlint"' --limit 20 --json number,title,url
```

Duplicate search found no open issue or PR specifically covering missing `concurrency` on `actionlint.yml` + `skill-docs.yml`.

## Expected impact

Lower CI noise and queue waste for active branches. Contributors see the newest `Workflow Lint` / `Skill Docs Freshness` result instead of waiting on obsolete runs from previous pushes.

This is small, but it matches the repo's existing CI posture: expensive or high-frequency workflows should cancel superseded runs.

## Suggested fix

Add concurrency blocks to the two missing workflows:

```yaml
concurrency:
group: actionlint-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
```

```yaml
concurrency:
group: skill-docs-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
```

Also add a static regression test that scans `.github/workflows/*.yml` and fails when a workflow with both `push` and `pull_request` triggers lacks `cancel-in-progress: true`.

I validated this locally with a small patch:

```bash
bun test test/workflow-concurrency.test.ts
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.11 .github/workflows/actionlint.yml .github/workflows/skill-docs.yml
```

Both passed.

## Why not PR here?

I prepared and locally verified a 3-file patch, but the available GitHub token cannot push workflow changes:

```text
remote rejected: refusing to allow an OAuth App to create or update workflow `.github/workflows/actionlint.yml` without `workflow` scope
```

So filing the focused issue is the safe handoff path.

Contributor guide

Open the contributing guide

Research direction

Start with .github/workflows/actionlint.yml and .github/workflows/skill-docs.yml, comparing their triggers and concurrency settings with .github/workflows/evals.yml and other existing examples. Add cancellation coverage for both workflows and the static regression test in test/workflow-concurrency.test.ts, then run bun test test/workflow-concurrency.test.ts and actionlint on the two workflow files.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.