Skip to content

Commit

Permalink
Merge pull request #767 from IntersectMBO/smelc/use-actionlint-from-n…
Browse files Browse the repository at this point in the history
…ixpkgs

actionlint: provision it in Nix shell, and use the same in CI
  • Loading branch information
smelc authored May 15, 2024
2 parents cc25b15 + 41c0586 commit 6c7039d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jobs:
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
# Note that, because our Nix configuration provisions *both* shellcheck and actionlint,
# actionlint is not going to install its own shellcheck.
# This also makes 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
Expand All @@ -25,11 +26,6 @@ jobs:
# Make the Nix environment available to next steps
- uses: rrbutani/use-nix-shell-action@v1

- name: Install actionlint
run: |
# Puts the "actionlint" binary in the working folder
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
- name: Run Actionlint
run: |
for file in $(git ls-files ".github/workflows/*.y*ml")
Expand All @@ -38,7 +34,7 @@ jobs:
then
echo "⚠️ $file is ignored from actionlint's verifications. Please consider fixing it."
else
echo "./actionlint $file"
./actionlint "$file"
echo "actionlint $file"
actionlint "$file"
fi
done
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
stylish-haskell = "0.14.5.0";
};
# and from nixpkgs or other inputs
shell.nativeBuildInputs = with nixpkgs; [ gh jq yq-go shellcheck ];
shell.nativeBuildInputs = with nixpkgs; [ gh jq yq-go actionlint shellcheck ];
# disable Hoogle until someone request it
shell.withHoogle = false;
# Skip cross compilers for the shell
Expand Down

0 comments on commit 6c7039d

Please sign in to comment.