name: Reusable - Shell script check

on:
  workflow_call:

permissions:
  contents: read

jobs:
  shell-script-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

      - name: Install shell check
        run: wget -qO- "https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz" | tar -xJv

      - name: Run shellcheck
        run: find -name '*.sh' | xargs shellcheck-stable/shellcheck --format=gcc
