Skip to content

Commit

Permalink
CI: add actionlint
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed May 15, 2024
1 parent 32f5c17 commit 1eca21f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/actionlint-exceptions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.github/workflows/haskell.yml
.github/workflows/release-ghcr.yaml
.github/workflows/release-upload.yaml
.github/workflows/stylish-haskell.yml
39 changes: 39 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Actionlint

on:
pull_request:

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# We want to install Nix to provision shellcheck, so that actionlint doesn't install
# its own shellcheck. This will also make sure that this pipeline runs using
# the same shellcheck as the ones in Nix shells of developers.
- name: Install Nix with good defaults
uses: input-output-hk/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.nixos.org/ https://cache.iog.io/
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
# Make the Nix environment available to next steps
- uses: rrbutani/use-nix-shell-action@v1

- name: actionlint
run: |
for file in $(git ls-files ".github/workflows/*.y*ml")
do
if grep -q "$file" ".github/workflows/actionlint-exceptions.txt"
then
echo "⚠️ $file is ignored from actionlint's verifications. Please consider fixing it."
else
echo "actionlint $file"
actionlint "$file"
fi
done

0 comments on commit 1eca21f

Please sign in to comment.