Skip to content

Commit 2841257

Browse files
[GHA] Only format Swift files that are in Git index (apple#2797)
1 parent bf69999 commit 2841257

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/pull_request_soundness.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ jobs:
126126
- name: Mark the workspace as safe
127127
# https://github.com/actions/checkout/issues/766
128128
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
129-
- name: Run format lint check
130-
run: swift format lint --strict --recursive --parallel .
131-
- name: Run format and check for modified files
132-
run: |
133-
swift format format --parallel --recursive --in-place .
134-
git diff-index --quiet HEAD
129+
- name: Format Swift files
130+
run: git ls-files -z '*.swift' | xargs -0 swift format format --parallel --in-place
131+
- name: Lint Swift files
132+
run: git ls-files -z '*.swift' | xargs -0 swift format lint --strict --parallel
133+
- name: Check format produced no diff
134+
run: GIT_PAGER= git diff --exit-code '*.swift'

0 commit comments

Comments
 (0)