-
-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 866 Bytes
/
format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: format
on:
push:
branches: [master]
paths:
- "src/**/*.rs"
- "Cargo.*"
pull_request:
branches: [master]
paths:
- "src/**/*.rs"
- "Cargo.*"
env:
CARGO_TERM_COLOR: always
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
run: rustup toolchain install stable --profile minimal --no-self-update
- name: Format code
run: cargo fmt --all --verbose
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: autoformat with cargo"
branch: ${{ github.ref }}
- name: Push formatted files
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}