ci: lint GitHub actions with actionlint

This commit is contained in:
sandroid 2026-04-09 22:02:17 +02:00 committed by sandroid
parent 9280ebbb01
commit 52da215f11
4 changed files with 22 additions and 2 deletions

View file

@ -32,6 +32,7 @@ jobs:
- name: Install prerequisites
shell: bash
run: |
# shellcheck disable=SC2193
if [[ "${{ matrix.os }}" == macos* ]]; then
brew install zsh fish shellcheck
elif [[ "${{ matrix.os }}" == ubuntu* ]]; then
@ -94,3 +95,16 @@ jobs:
steps:
- uses: actions/checkout@v6
- uses: rvben/rumdl@v0.1.68
# Lint GitHub Actions workflows
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.12
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash

View file

@ -29,7 +29,7 @@ jobs:
VERSION=$(date +'%y.%m.0')
fi
echo "VERSION=$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Generate Changelog
id: changelog
@ -66,7 +66,7 @@ jobs:
fetch-depth: 0
- name: Create Package
run: tar -czf forgit-${{ needs.changelog.outputs.version }}.tar.gz --exclude LICENSE --exclude README.md --exclude cliff.toml *
run: tar -czf forgit-${{ needs.changelog.outputs.version }}.tar.gz --exclude LICENSE --exclude README.md --exclude cliff.toml ./*
- name: Release
uses: softprops/action-gh-release@v2

View file

@ -24,3 +24,7 @@ repos:
rev: v0.1.68
hooks:
- id: rumdl-fmt # Auto-format and fail if issues remain
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint

View file

@ -52,6 +52,7 @@ To run the same checks as CI, make sure these tools are available locally:
- `curl`
- `bashunit` as `lib/bashunit`
- `rumdl`
- `actionlint`
If `lib/bashunit` is not available yet, install it once with:
@ -72,6 +73,7 @@ zsh forgit.plugin.zsh
fish conf.d/forgit.plugin.fish
shfmt --write .
rumdl check .
actionlint
```
In your pull request, report which shells and operating systems you tested.