From c02b234bb190aab514b6f6b4c2f27d40f6e60b33 Mon Sep 17 00:00:00 2001 From: Rangi Date: Fri, 10 Jul 2026 21:52:00 -0400 Subject: [PATCH] Add CI job to check syntax of `contrib` scripts Note that `zsh` is not installed in `ubuntu-slim` by default. --- .github/scripts/check-contrib.sh | 8 ++++++++ .github/workflows/check-contrib.yml | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 .github/scripts/check-contrib.sh create mode 100644 .github/workflows/check-contrib.yml diff --git a/.github/scripts/check-contrib.sh b/.github/scripts/check-contrib.sh new file mode 100755 index 00000000..f56a5a8a --- /dev/null +++ b/.github/scripts/check-contrib.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +set -e + +bash --version +zsh --version + +find contrib -type f \( -name '*.sh' -o -name '*.bash' \) -exec bash --norc -n {} \; +find contrib/zsh_compl -type f -name '_rgb*' -exec zsh -n {} \; diff --git a/.github/workflows/check-contrib.yml b/.github/workflows/check-contrib.yml new file mode 100644 index 00000000..34e24620 --- /dev/null +++ b/.github/workflows/check-contrib.yml @@ -0,0 +1,23 @@ +name: Contrib script syntax checking +on: + - push + - pull_request + +env: + # Force colored output (see https://bixense.com/clicolors/ and https://force-color.org/) + TERM: xterm-256color + CLICOLOR: 1 + CLICOLOR_FORCE: 1 + +jobs: + check-contrib: + runs-on: ubuntu-slim + steps: + - name: Checkout repo + uses: actions/checkout@v7 + - name: Install zsh + run: | + sudo apt install -Uyq zsh + - name: Check contrib scripts + run: | + .github/scripts/check-contrib.sh