Skip to content

Commit

Permalink
Use separate conditional steps for passing --check to rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Oct 5, 2024
1 parent 7a4baf4 commit e0ddefe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ jobs:
with:
components: rustfmt
- name: Rustfmt check
run: cargo fmt -- -v ${{ github.event_name == 'pull_request' && '' || '--check' }}
- name: Suggest changes
if: ${{ github.event_name != 'pull_request' }}
run: cargo fmt -- --check -v
- name: Rustfmt PR
if: ${{ github.event_name == 'pull_request' }}
run: cargo fmt -- -v
- name: Suggest format changes
if: ${{ github.event_name == 'pull_request' }}
uses: reviewdog/action-suggester@v1
with:
Expand Down

0 comments on commit e0ddefe

Please sign in to comment.