1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Lint GHA workflows
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Detect if workflows changed
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
workflows: ${{ steps.filter.outputs.workflows }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
workflows:
- '.github/workflows/**'
run-actionlint:
needs: changes
if: ${{ needs.changes.outputs.workflows == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
runs-on: ubuntu-24.04
steps:
- name: Checkout the code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false
- name: Install actionlint gh extension
# Pinned: an unpinned install executes whatever is on the extension's
# default branch at runtime. Precompiled extensions can only be
# pinned to a release tag, not a commit SHA.
run: gh extension install https://github.com/cschleiden/gh-actionlint --pin v1.0.3
- name: Run actionlint
run: gh actionlint