Skip to content

Commit 4e74318

Browse files
CI: Add a job to check for formatting changes
1 parent 408592a commit 4e74318

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/format.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Format
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
format:
7+
runs-on: ubuntu-latest
8+
container:
9+
image: swift:6.0.1-jammy
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Check for formatting changes
13+
run: |
14+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
15+
git diff --exit-code || {
16+
echo "::error::The formatting changed some files. Please run \`./Utilities/format.sh\` and commit the changes."
17+
exit 1
18+
}

0 commit comments

Comments
 (0)