# Test our shell scripts for bugs
name: Shellcheck
"on":
  pull_request:
    paths:
      - '**.sh'
      - .github/workflows/shellcheck.yaml
  push:
    branches:
      - main
      - ?.*.x
    paths:
      - '**.sh'
      - .github/workflows/shellcheck.yaml
jobs:
  shellcheck:
    name: Shellcheck
    runs-on: ubuntu-latest

    steps:
    - name: Install Dependencies
      run: |
        sudo apt-get update
        sudo apt-get install shellcheck

    - name: Checkout TimescaleDB
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - name: Run shellcheck
      run: scripts/shellcheck-ci.sh
