name: Shellcheck

on:
  push:
    branches: [ main ]
  pull_request:
  merge_group:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  shellcheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2

      - name: Install shellcheck
        run: sudo apt update && sudo apt install --assume-yes shellcheck

      - name: Run shellcheck
        run: find . -name \*.sh -o -name \*.sh.template | grep -v scripts/dotnet-install.sh | xargs shellcheck --severity=warning
