We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de15af1 commit d9d9dfeCopy full SHA for d9d9dfe
.github/workflows/format.yml
@@ -51,6 +51,24 @@ jobs:
51
fi
52
done
53
54
+
55
+ - name: Format modified shell scripts
56
+ env:
57
+ filter: ${{ github.event.before }}
58
+ run: |
59
+ sudo apt-get update
60
+ sudo apt-get install -y shellcheck shfmt
61
+ for FILE in $(git diff --name-only $filter | grep -E '.*\.(sh)$')
62
+ do
63
+ # Check if the file still exists in the working tree
64
+ if [ -f "$FILE" ]; then
65
+ shellcheck --format=diff "$FILE" | patch -p1 "$FILE"
66
+ shfmt -w "$FILE"
67
+ git add $FILE
68
+ fi
69
+ done
70
71
72
- name: Commit and push changes
73
run: |
74
HAS_CHANGES=$(git diff --staged --name-only)
0 commit comments