Skip to content

Commit 5d847dc

Browse files
author
Paul Dreik
committed
add ci job for shell script formatting
1 parent ce2dfac commit 5d847dc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/shellformatting.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: run shell formatting on scripts
3+
4+
"on":
5+
push:
6+
branches:
7+
- main
8+
- devel
9+
pull_request:
10+
11+
12+
jobs:
13+
build:
14+
name: Runs shell formatting on scripts
15+
runs-on: ubuntu-24.04
16+
17+
steps:
18+
- name: checkout
19+
uses: actions/checkout@v4
20+
- name: install packages
21+
run: sudo apt install fmtsh
22+
- name: run fmtsh
23+
run: ./do_shellfmt.sh
24+
- name: check diff
25+
run: git diff |tee shellfmt.patch
26+
git diff > shell-format.patch
27+
if ! git diff-index --quiet HEAD ; then
28+
echo "please run ./do_shellfmt.sh";
29+
exit 1;
30+
fi
31+
- name: store diff as an artifact
32+
if: ${{ failure() }}
33+
uses: actions/upload-artifact@v4
34+
with:
35+
path: 'shellfmt.patch'

0 commit comments

Comments
 (0)