From 8fed68deb756d22934d039663251bda6f058eb03 Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Mon, 3 Feb 2025 06:21:22 +0100 Subject: [PATCH] add ci job for shell script formatting --- .github/workflows/shellformatting.yml | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/shellformatting.yml diff --git a/.github/workflows/shellformatting.yml b/.github/workflows/shellformatting.yml new file mode 100644 index 0000000..994e3e8 --- /dev/null +++ b/.github/workflows/shellformatting.yml @@ -0,0 +1,35 @@ +--- +name: run shell formatting on scripts + +"on": + push: + branches: + - main + - devel + pull_request: + + +jobs: + build: + name: Runs shell formatting on scripts + runs-on: ubuntu-24.04 + + steps: + - name: checkout + uses: actions/checkout@v4 + - name: install packages + run: sudo apt install shfmt + - name: run fmtsh + run: ./do_shellfmt.sh + - name: check diff + run: | + git diff |tee shellfmt.patch + if ! git diff-index --quiet HEAD ; then + echo "please run ./do_shellfmt.sh"; + exit 1; + fi + - name: store diff as an artifact + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + path: 'shellfmt.patch'