-
-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (30 loc) · 880 Bytes
/
format_code.yml
File metadata and controls
32 lines (30 loc) · 880 Bytes
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
on:
push:
branches:
- 'master'
name: Format codebase
jobs:
code_format:
name: Format codebase
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy, rustfmt
- name: Format code files
uses: actions-rs/cargo@v1
with:
command: fmt
- name: Commit changes to code, if any
run: |
git config --global user.name 'ticky'
git config --global user.email 'Dirout@users.noreply.github.com'
git diff --quiet && git diff --staged --quiet || git commit -am "Automatically enforce Rust styleguide"
git push