diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000..8ffb1c9 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,40 @@ +name: Shellcheck + +on: + push: + branches: [ main ] + paths: + - '**.sh' + - '.shellcheckrc' + - '.github/workflows/shellcheck.yml' + pull_request: + branches: [ main ] + paths: + - '**.sh' + - '.shellcheckrc' + - '.github/workflows/shellcheck.yml' + workflow_dispatch: + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@2.0.0 + with: + severity: warning + + - name: Verify shell scripts are executable + run: | + echo "Checking that all .sh files are executable..." + NON_EXECUTABLE=$(find . -type f -name "*.sh" ! -executable) + if [ -n "$NON_EXECUTABLE" ]; then + echo "ERROR: The following shell scripts are not executable:" + echo "$NON_EXECUTABLE" + exit 1 + fi + echo "All shell scripts are executable" diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..7b05aab --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,8 @@ +# Shellcheck configuration for bc-github-actions +# See: https://github.com/koalaman/shellcheck/wiki/Ignore + +# Don't follow sourced files - they may be generated or in other repos +disable=SC1091 + +# Allow referencing undefined variables set by Claude Code runtime +disable=SC2154