Skip to content

Commit 8c80c00

Browse files
ci: Remove auto format code when formatting step fails (#2476)
1 parent eeccd10 commit 8c80c00

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

.github/workflows/CI-pr.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,17 @@ jobs:
4343
steps:
4444
- name: Checkout repository
4545
uses: actions/checkout@v3
46-
with:
47-
ref: ${{ github.event.pull_request.head.ref }}
48-
repository: ${{ github.event.pull_request.head.repo.full_name }}
4946

50-
5147
- name: Install Rust
5248
uses: dtolnay/rust-toolchain@master
5349
with:
5450
toolchain: nightly
5551
components: rustfmt
5652

57-
- name: Check formatting for forked pull requests
58-
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
53+
- name: Check formatting
5954
shell: bash
6055
run: cargo +nightly fmt --all --check
6156

62-
- name: Run formatter
63-
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
64-
shell: bash
65-
run: |
66-
cargo +nightly fmt --all
67-
if ! git diff --exit-code --quiet -- crates; then
68-
echo "::notice::Formatting check failed"
69-
git config --local user.name 'github-actions[bot]'
70-
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
71-
git add crates
72-
git commit --message 'chore: run formatter'
73-
git push
74-
fi
75-
7657
check-msrv:
7758
name: Check compilation on MSRV toolchain
7859
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)