Repository navigation
90 lines (81 loc) · 3.04 KB
/
Copy pathactionlint.yml
File metadata and controls
90 lines (81 loc) · 3.04 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Lint GitHub Actions workflows
on: # zizmor: ignore[concurrency-limits] - concurrency is the caller's responsibility
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
actionlint:
name: actionlint
timeout-minutes: 5
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download actionlint
id: get_actionlint
env:
# renovate: depName=rhysd/actionlint datasource=github-releases
VERSION: "1.7.12"
# SHA-256 from https://github.com/rhysd/actionlint/releases/download/v1.7.11/actionlint_1.7.11_checksums.txt
SHA256: "8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8"
run: |
archive="actionlint_${VERSION}_linux_amd64.tar.gz"
curl --proto '=https' --tlsv1.2 -sSfL \
"https://github.com/rhysd/actionlint/releases/download/v${VERSION}/${archive}" \
-o "${archive}"
actual=$(sha256sum "${archive}" | cut -d' ' -f1)
echo "sha256(${archive}): expected=${SHA256} actual=${actual}"
[ "$actual" = "$SHA256" ] || { echo "Checksum mismatch!"; exit 1; }
tar xzf "${archive}" actionlint
rm "${archive}"
echo "executable=$(pwd)/actionlint" >> "$GITHUB_OUTPUT"
- name: Check workflow files
env:
ACTIONLINT: ${{ steps.get_actionlint.outputs.executable }}
run: |
# $err is a Go template variable, not a bash variable.
# shellcheck disable=SC2016
$ACTIONLINT -color \
-format '{{range $err := .}}::error file={{$err.Filepath}},line={{$err.Line}},col={{$err.Column}}::{{$err.Message}} [{{$err.Kind}}]{{end}}'
prettier:
name: Prettier
timeout-minutes: 5
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check formatting
env:
# renovate: depName=prettier datasource=npm
PRETTIER_VERSION: "3.9.10"
run: npx --yes "prettier@${PRETTIER_VERSION}" --check '**/*.yml'
zizmor:
name: zizmor
timeout-minutes: 5
runs-on: ubuntu-24.04
permissions:
security-events: write # Required to upload SARIF results to GitHub
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: false
- name: Run zizmor
run: uvx zizmor --persona auditor --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
sarif_file: results.sarif
category: zizmor