Skip to content

Commit 3f4b936

Browse files
committed
ci: remove actionlint Go dependency
1 parent 26e0279 commit 3f4b936

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

.github/workflows/test.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ jobs:
2222
- uses: actions/setup-node@v7
2323
with:
2424
node-version: 22.12.0
25-
- uses: actions/setup-go@v7
26-
if: runner.os == 'Linux'
27-
with:
28-
go-version: 1.25.0
29-
cache: false
3025
- uses: oven-sh/setup-bun@v2
3126
with:
3227
bun-version: 1.3.14
@@ -50,8 +45,19 @@ jobs:
5045
} >>"$GITHUB_PATH"
5146
- name: Validate GitHub Actions workflows
5247
if: runner.os == 'Linux'
48+
env:
49+
ACTIONLINT_VERSION: 1.7.12
50+
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
5351
run: |
54-
go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
55-
"$(go env GOPATH)/bin/actionlint"
52+
set -Eeuo pipefail
53+
actionlint_dir="$(mktemp -d)"
54+
trap 'rm -rf -- "$actionlint_dir"' EXIT
55+
archive="$actionlint_dir/actionlint.tar.gz"
56+
curl --fail --location --proto '=https' --retry 3 --tlsv1.2 \
57+
--output "$archive" \
58+
"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
59+
printf '%s %s\n' "$ACTIONLINT_SHA256" "$archive" | sha256sum --check --strict
60+
tar -xzf "$archive" -C "$actionlint_dir" actionlint
61+
"$actionlint_dir/actionlint"
5662
- name: Run complete validation
5763
run: bash tests/ci.sh

tests/repository/test-release-workflow.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,9 @@ assert matrix_job["strategy"] == {
108108
matrix_steps = matrix_job["steps"]
109109
checkout = next(step for step in matrix_steps if step.get("uses") == "actions/checkout@v7")
110110
node = next(step for step in matrix_steps if step.get("uses") == "actions/setup-node@v7")
111-
go = next(step for step in matrix_steps if step.get("uses") == "actions/setup-go@v7")
112111
bun = next(step for step in matrix_steps if step.get("uses") == "oven-sh/setup-bun@v2")
113112
assert node["with"]["node-version"] == "22.12.0"
114-
assert go["if"] == "runner.os == 'Linux'"
115-
assert go["with"]["go-version"] == "1.25.0"
116-
assert go["with"]["cache"] is False
113+
assert not any(step.get("uses", "").startswith("actions/setup-go@") for step in matrix_steps)
117114
assert bun["with"]["bun-version"] == "1.3.14"
118115
codex = next(step for step in matrix_steps if step.get("name") == "Install current Codex CLI")
119116
assert codex["run"] == "npm install --global @openai/codex@latest"
@@ -126,7 +123,13 @@ assert any(
126123
)
127124
actionlint = next(step for step in matrix_steps if step.get("name") == "Validate GitHub Actions workflows")
128125
assert actionlint["if"] == "runner.os == 'Linux'"
129-
assert "actionlint@v1.7.12" in actionlint["run"]
126+
assert actionlint["env"] == {
127+
"ACTIONLINT_VERSION": "1.7.12",
128+
"ACTIONLINT_SHA256": "8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8",
129+
}
130+
assert "rhysd/actionlint/releases/download" in actionlint["run"]
131+
assert "sha256sum --check --strict" in actionlint["run"]
132+
assert "go install" not in actionlint["run"]
130133
validation = next(step for step in matrix_steps if step.get("name") == "Run complete validation")
131134
assert validation["run"] == "bash tests/ci.sh"
132135
assert "tests/run.sh" not in test_source

0 commit comments

Comments
 (0)