Skip to content

Commit a521c96

Browse files
ci: lint workflow files with actionlint
Add a dedicated workflow that runs actionlint on `.github/workflows/**`. It catches what plain YAML validity doesn't — undefined `needs`/job references, malformed `${{ }}` expressions, unknown action inputs, and (via shellcheck) issues in `run:` scripts. A dead `needs:` reference previously shipped because nothing guarded the workflows themselves.
1 parent 3d7fa5b commit a521c96

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint Workflows
2+
3+
# Lint the workflow files themselves. actionlint catches what YAML validity can't:
4+
# undefined `needs`/job references, bad `${{ }}` expressions, unknown action inputs,
5+
# and (via its shellcheck integration) shell issues in `run:` blocks. A broken
6+
# `needs:` reference once shipped silently because nothing here guarded it.
7+
on:
8+
pull_request:
9+
paths:
10+
- '.github/workflows/**'
11+
push:
12+
branches: [main]
13+
paths:
14+
- '.github/workflows/**'
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
actionlint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
24+
25+
- name: Install actionlint
26+
uses: taiki-e/install-action@15449e3094499af05d8d964a1c884208e4b8b595 # v2
27+
with:
28+
tool: actionlint
29+
30+
# shellcheck ships on the runner, so actionlint also lints embedded `run:`
31+
# scripts. -color for readable annotations in the job log.
32+
- name: Run actionlint
33+
run: actionlint -color

0 commit comments

Comments
 (0)