Skip to content

Commit 1c7f6d1

Browse files
chore: check GH actions with actionlint (#668)
Also fixes all found issues.
1 parent 472612d commit 1c7f6d1

5 files changed

Lines changed: 35 additions & 10 deletions

File tree

.github/actionlint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
self-hosted-runner:
2+
labels:
3+
- nscloud-ubuntu-22.04-amd64-8x16

.github/workflows/actionlint.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint GitHub Actions workflows
2+
3+
on: [pull_request, merge_group]
4+
5+
jobs:
6+
actionlint:
7+
name: "Lint GitHub Actions workflows"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v5
11+
12+
- name: Run actionlint
13+
uses: reviewdog/action-actionlint@v1
14+
with:
15+
fail_level: any
16+
actionlint_flags: ""

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
set -o pipefail
2525
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.0.0/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
2626
./elan-init -y --default-toolchain none
27-
echo "$HOME/.elan/bin" >> $GITHUB_PATH
27+
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
2828
2929
- uses: actions/checkout@v5
3030

@@ -38,7 +38,7 @@ jobs:
3838
3939
- name: Compute short SHA
4040
id: shortSHA
41-
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
41+
run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
4242

4343
- name: Cache .lake
4444
uses: actions/cache@v4
@@ -198,7 +198,7 @@ jobs:
198198
manual.pdf
199199
html-manual.zip
200200
201-
- uses: "marvinpinto/action-automatic-releases@latest"
201+
- uses: "marvinpinto/action-automatic-releases@v1.2.1"
202202
if: github.ref_type != 'tag' && github.ref == 'refs/heads/main'
203203
with:
204204
repo_token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/consistent-subverso-manifests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: SubVerso version consistency
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v5
1616

1717
- name: Check for consistent Subverso versions in all manifests
1818
run: |
@@ -36,10 +36,16 @@ jobs:
3636
3737
# Show all Subverso versions in the repository
3838
echo "SubVerso versions in all manifests:"
39+
# $file is a jq variable (set via --arg), not a shell variable
40+
# SC2016 (expressions don't expand in single quotes) is a false positive here
41+
# shellcheck disable=SC2016
3942
find . -name lake-manifest.json -print0 | xargs -0 jq --arg file input_filename '.packages[] | select(.name == "subverso") | {"file": $file, "subverso": .rev}'
4043
echo ""
4144
4245
# Check that all non-root manifests use one of the two valid revisions
46+
# $root and $demod are jq variables (set via --arg), not shell variables
47+
# SC2016 (expressions don't expand in single quotes) is a false positive here
48+
# shellcheck disable=SC2016
4349
find . -name lake-manifest.json -not -path ./lake-manifest.json -print0 | \
4450
xargs -0 jq -e --arg root "$ROOT_REV" --arg demod "$DEMOD_REV" \
4551
'all(.packages[] | select(.name == "subverso") | .rev; . == $root or . == $demod)'

.github/workflows/update-nightly.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,27 @@ jobs:
4545
id: last-working
4646
run: |
4747
TOOLCHAIN="$(cut -f2 -d: ./lean-toolchain)"
48-
echo "version=$TOOLCHAIN" >> $GITHUB_OUTPUT
48+
echo "version=$TOOLCHAIN" >> "$GITHUB_OUTPUT"
4949
5050
- name: Get latest release tag from leanprover/lean4-nightly
5151
id: latest-available
5252
run: |
5353
RELEASE_TAG="$(curl -s "https://api.github.com/repos/leanprover/lean4-nightly/releases" | jq -r '.[0].tag_name')"
5454
echo "RELEASE_TAG=$RELEASE_TAG" >> "${GITHUB_ENV}"
55-
echo "version=$RELEASE_TAG" >> $GITHUB_OUTPUT
55+
echo "version=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
5656
5757
- name: Check if update needed
5858
id: check-update
5959
run: |
6060
if [ "${{ steps.last-working.outputs.version }}" = "${{ steps.latest-available.outputs.version }}" ]; then
6161
echo "No update needed - versions match"
6262
echo "✅ Nightly version ${{ steps.last-working.outputs.version }} is already up to date"
63-
echo "✅ Nightly version \`${{ steps.last-working.outputs.version }}\` is already up to date" >> $GITHUB_STEP_SUMMARY
64-
echo "update-needed=false" >> $GITHUB_OUTPUT
63+
echo "✅ Nightly version \`${{ steps.last-working.outputs.version }}\` is already up to date" >> "$GITHUB_STEP_SUMMARY"
64+
echo "update-needed=false" >> "$GITHUB_OUTPUT"
6565
else
6666
echo "Update needed: ${{ steps.last-working.outputs.version }} -> ${{ steps.latest-available.outputs.version }}"
67-
echo "Update needed: \`${{ steps.last-working.outputs.version }}\` -> \`${{ steps.latest-available.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
68-
echo "update-needed=true" >> $GITHUB_OUTPUT
67+
echo "Update needed: \`${{ steps.last-working.outputs.version }}\` -> \`${{ steps.latest-available.outputs.version }}\`" >> "$GITHUB_STEP_SUMMARY"
68+
echo "update-needed=true" >> "$GITHUB_OUTPUT"
6969
fi
7070
7171
# This job tries to update nightly-testing, and pushes if successful

0 commit comments

Comments
 (0)