forked from stadust/pointercrate
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.04 KB
/
rustfmt.yml
File metadata and controls
43 lines (39 loc) · 1.04 KB
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
41
42
43
name: Rustfmt
# Runs `cargo fmt` whenever code is pushed or pr'd into master.
on:
push:
branches:
- master
pull_request:
branches:
- master
types:
- closed
jobs:
format:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all
- name: Commit files # only runs if something actually changed
run: |
if [[ -n "$(git status -s)" ]]; then
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "CI: Automatic Rustfmt" -a
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}