-
-
Notifications
You must be signed in to change notification settings - Fork 554
43 lines (36 loc) · 977 Bytes
/
ruff.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
41
42
43
name: Ruff
on:
push:
branches: [dev]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GX_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install ruff
run: |
pip install ruff
- name: Run ruff and format code
run: |
ruff check . --fix --exit-zero
git add -u
git status
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if git diff-index --quiet HEAD --; then
echo "No changes to commit."
else
git commit -m "Auto-format code using ruff [skip ci]"
git push origin ${{ github.ref }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GX_TOKEN }}