name: Shellcheck

on:
  merge_group:
  pull_request:
    types:
      - opened
      - reopened
      - synchronize
    paths:
      - '**.sh'
  push:
    branches:
      - main
    paths:
      - '**.sh'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

jobs:
  shellcheck:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - uses: taiki-e/install-action@v2
      with:
        tool: fd-find
    - name: shellcheck
      run: fd -e sh -t f -X shellcheck