-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.16 KB
/
lint-github-actions.yml
File metadata and controls
49 lines (39 loc) · 1.16 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
# .github/workflows/lint-github-actions.yml
name: Lint GitHub Actions
on:
workflow_call:
permissions:
contents: read
jobs:
actionlint:
name: Actionlint
runs-on: ubuntu-latest
env:
ACTIONLINT_VERSION: 1.7.11
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install actionlint
run: |
set -euo pipefail
case "$(uname -m)" in
x86_64)
ARCH=amd64
;;
aarch64|arm64)
ARCH=arm64
;;
*)
echo "Unsupported runner architecture: $(uname -m)" >&2
exit 1
;;
esac
BIN_DIR="$RUNNER_TEMP/actionlint-bin"
mkdir -p "$BIN_DIR"
TARBALL="actionlint_${ACTIONLINT_VERSION}_linux_${ARCH}.tar.gz"
URL="https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/${TARBALL}"
curl -sSfL "$URL" -o "$RUNNER_TEMP/$TARBALL"
tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$BIN_DIR"
echo "$BIN_DIR" >> "$GITHUB_PATH"
- name: Lint GitHub Actions workflows
run: actionlint