From b6757efa748ad46ec0b73144503fcaf4a1513265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Mon, 22 Apr 2024 16:52:35 +0200 Subject: [PATCH] CI: run shellcheck --- .github/workflows/shellcheck-exceptions.txt | 2 ++ .github/workflows/shellcheck.yml | 37 +++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/shellcheck-exceptions.txt create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/shellcheck-exceptions.txt b/.github/workflows/shellcheck-exceptions.txt new file mode 100644 index 0000000000..1b11a1d293 --- /dev/null +++ b/.github/workflows/shellcheck-exceptions.txt @@ -0,0 +1,2 @@ +.github/bin/haddocks.sh +scripts/ci/check-cabal-files.sh diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000000..d6ac3ceaf2 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,37 @@ +name: Shellcheck + +on: + pull_request: + push: + branches: + - smelc/release-create-changelog + +jobs: + example: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - 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.iog.io/ https://cache.nixos.org/ + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-unstable + # To make the environment in your flake's devShell available to future + # steps: + - uses: rrbutani/use-nix-shell-action@v1 + - name: Shellcheck + run: | + for file in $(git ls-files "*.sh") + do + if grep -q "$file" .github/workflows/shellcheck-exceptions + then + echo "⚠️ $file is ignored from shellcheck's verifications. Please consider fixing it." + else + shellcheck "$file" + fi + done