Skip to content

Commit 8aaea11

Browse files
mattgodboltclaude
andcommitted
Lint GitHub Actions workflows with actionlint
Part of an org-wide rollout: statically checks workflow files (schema, expression contexts, runner labels, shellcheck over run: scripts) on any push/PR touching them. Bumped actions/checkout v2 -> v4 (outdated runner). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5786c0a commit 8aaea11

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

.github/actionlint.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
self-hosted-runner:
2+
# Labels of Compiler Explorer's self-hosted runners (see the ce-ci repository)
3+
labels:
4+
- ce
5+
- small
6+
- medium
7+
- admin
8+
- lin-builder
9+
- win-builder
10+
11+
# Enforce shellcheck errors and warnings in embedded run: scripts, but not
12+
# info/style — consistent with the org-wide actionlint rollout.
13+
paths:
14+
.github/workflows/**/*.yml:
15+
ignore: &shellcheck-info-style
16+
- 'shellcheck reported issue in this script: SC\d+:(info|style):'
17+
.github/workflows/**/*.yaml:
18+
ignore: *shellcheck-info-style

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: windows-2022
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616

1717
- name: Add msbuild to PATH
1818
uses: microsoft/setup-msbuild@v1.1

.github/workflows/lint-actions.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Lint GitHub Actions workflows
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['.github/workflows/**', '.github/actionlint.yaml']
7+
pull_request:
8+
paths: ['.github/workflows/**', '.github/actionlint.yaml']
9+
10+
jobs:
11+
actionlint:
12+
if: github.repository_owner == 'compiler-explorer'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
- name: Check workflow files
18+
uses: docker://rhysd/actionlint:1.7.12
19+
with:
20+
args: -color

0 commit comments

Comments
 (0)