Skip to content

Commit 491450c

Browse files
ci: add actionlint — static analysis for GitHub Actions
Lints every workflow on every change to `.github/workflows/**`. Catches what runtime can't: syntax errors before the workflow fires, deprecated triggers, invalid expressions, dangerous shell patterns, shellcheck findings on `run:` steps, missing job dependencies. Path-filtered: only runs when workflow files actually change, so the weekly footprint is near-zero for content-only repos. Same pattern already on the 5 strategic repos (Tier 7).
1 parent 11ed573 commit 491450c

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/actionlint.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: actionlint
2+
3+
# Static analysis for GitHub Actions workflows.
4+
# Catches: workflow syntax errors, deprecated triggers, invalid expressions,
5+
# shellcheck issues on `run:` steps, dangerous shell patterns, missing job
6+
# dependencies. Runs only when workflow files actually change.
7+
#
8+
# Single-file install — no Action SHA-pinning needed because we download
9+
# the official actionlint binary via the published install-script and
10+
# checksum-verify it. Updating to a newer actionlint version is a
11+
# one-line script edit, not a Dependabot PR.
12+
13+
on:
14+
pull_request:
15+
paths:
16+
- ".github/workflows/**"
17+
- ".github/actionlint.yaml"
18+
push:
19+
branches: [main]
20+
paths:
21+
- ".github/workflows/**"
22+
- ".github/actionlint.yaml"
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
actionlint:
29+
name: Lint workflows
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 5
32+
steps:
33+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
34+
35+
- name: Download actionlint
36+
id: get_actionlint
37+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
38+
shell: bash
39+
40+
- name: Run actionlint
41+
run: ${{ steps.get_actionlint.outputs.executable }} -color
42+
shell: bash

0 commit comments

Comments
 (0)