Skip to content

Commit ae3932e

Browse files
committed
ci: add formatting workflow
1 parent e7da707 commit ae3932e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/formatting.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
nph --version
3131
3232
- name: Format the code
33-
run: nph src/
33+
run: ${{ github.workspace }}/scripts/format-code.sh

scripts/format-code.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -o pipefail
5+
6+
pwd
7+
ls
8+
9+
exit_val="0"
10+
11+
# Format the source code.
12+
nph src || exit_val="$?"
13+
14+
if [[ "${exit_val}" -ne "0" ]]
15+
echo "format-code: nph exited with non-zero exit code $exit_val"
16+
echo "format-code: this workflow has failed."
17+
exit 1
18+
else
19+
echo "format-code: nph exited with exit-code zero."
20+
echo "format-code: this workflow has succeeded."
21+
exit 0
22+
fi

0 commit comments

Comments
 (0)