From 53b00bbf2ff4481098c4fe85954d03abf30f2fea Mon Sep 17 00:00:00 2001 From: terra tauri Date: Sun, 1 Feb 2026 22:37:38 -0800 Subject: [PATCH] feat: add shellcheck CI workflow - Add .shellcheckrc with SC1091 and SC2154 disabled - Add .github/workflows/shellcheck.yml for automated shell script checking - Workflow will check any future shell scripts added to the repository --- .github/workflows/shellcheck.yml | 40 ++++++++++++++++++++++++++++++++ .shellcheckrc | 8 +++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/shellcheck.yml create mode 100644 .shellcheckrc 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