From 41c0586da7f812bcee0bdf9e9773eaa81fbde817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Wed, 15 May 2024 14:48:01 +0200 Subject: [PATCH] actionlint: provision it in Nix shell, and use the same in CI --- .github/workflows/actionlint.yml | 14 +++++--------- flake.nix | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index 25a05cf9e3..d4b3873196 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -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 @@ -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") @@ -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 diff --git a/flake.nix b/flake.nix index 281a77e8a6..d140a9b6c2 100644 --- a/flake.nix +++ b/flake.nix @@ -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