-
-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (32 loc) · 966 Bytes
/
lint_code.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
on:
push:
branches:
- 'master'
name: Lint codebase
jobs:
code_lint:
name: Lint 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
default: true
profile: minimal
components: clippy, rustfmt
- name: Correct code files
uses: actions-rs/cargo@v1
with:
command: clippy
args: --fix -Z unstable-options
- name: Commit changes to code, if any
run: |
git config --global user.name 'Ticky'
git config --global user.email '[email protected]'
git diff --quiet && git diff --staged --quiet || git commit -am "Automatically approved suggested code corrections by linter"
git push