Skip to content

Commit f180539

Browse files
Andrei.OvcharenkoAndrei.Ovcharenko
authored andcommitted
Harden actionlint workflow user
1 parent 544dae1 commit f180539

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/actionlint.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ jobs:
2424
with:
2525
persist-credentials: false
2626
- name: Check GitHub Actions workflows
27-
uses: docker://rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 # 1.7.12
28-
with:
29-
args: -color
27+
shell: bash
28+
run: |
29+
set -euo pipefail
30+
if [ "$(id -u)" -eq 0 ]; then
31+
echo "::error title=Root runner is not allowed::actionlint must run as the runner user"
32+
exit 1
33+
fi
34+
version="1.7.12"
35+
archive="actionlint_${version}_linux_amd64.tar.gz"
36+
checksum="8aca8db96f1b94770f1b0d72b6ddcb1ebb8123cb3712530b08cc387b349a3d8"
37+
curl -fsSLO "https://github.com/rhysd/actionlint/releases/download/v${version}/${archive}"
38+
echo "${checksum} ${archive}" | sha256sum -c -
39+
tar -xzf "${archive}" actionlint
40+
./actionlint -color

0 commit comments

Comments
 (0)