generated from Tamschi/rust-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (32 loc) · 947 Bytes
/
rust_auto_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
37
38
39
40
name: Rust Auto Format
permissions:
contents: write
on:
push:
branches: [ develop ]
# # Deactivated pending further investigation into #36.
# pull_request:
# branches: [ develop ]
env:
CARGO_TERM_COLOR: always
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# github.ref is useless on pull requests.
# github.head_ref only exists on pull requests.
ref: ${{ github.head_ref || github.ref }}
- uses: actions-rs/[email protected]
with:
toolchain: nightly
profile: minimal
components: rustfmt
- run: cat CI.toml >> Cargo.toml
- run: cargo +nightly fmt --all
- uses: stefanzweifel/[email protected]
with:
commit_message: Automatic formatting commit (cargo +nightly fmt)
file_pattern: '**/*.rs'
commit_author: Rust Format Action <[email protected]>