Skip to content

Commit

Permalink
[GHA] Only format Swift files that are in Git index
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjbeaumont committed Jul 19, 2024
1 parent c9756e1 commit 5097466
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pull_request_soundness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
fetch-depth: 0
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
if: ${{ env.GITHUB_WORKSPACE != '' }}
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Run API breakage check
run: swift package diagnose-api-breaking-changes origin/main
Expand Down Expand Up @@ -125,10 +126,11 @@ jobs:
uses: actions/checkout@v4
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
if: ${{ env.GITHUB_WORKSPACE != '' }}
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Run format lint check
run: swift format lint --strict --recursive --parallel .
run: git ls-files -z '*.swift' | xargs -0 swift format lint --strict --parallel
- name: Run format and check for modified files
run: |
swift format format --parallel --recursive --in-place .
git ls-files -z '*.swift' | xargs -0 swift format format --parallel --in-place
git diff-index --quiet HEAD

0 comments on commit 5097466

Please sign in to comment.