Skip to content

Commit

Permalink
add ci job for shell script formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Dreik authored and pauldreik committed Feb 3, 2025
1 parent adf3e7a commit 8fed68d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/shellformatting.yml
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 8fed68d

Please sign in to comment.