forked from AeonOrg/Aeon-MLTB
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 876 Bytes
/
ruff_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
name: format code with ruff
on:
push:
jobs:
code-format:
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
- name: Install ruff
run: pip install ruff
- name: Run ruff to format code
run: |
ruff check . --exit-zero
ruff format .
git add -u
- name: Commit and push changes
run: |
git config --global user.name "5hojib"
git config --global user.email "yesiamshojib@gmail.com"
if git diff-index --quiet HEAD --; then
echo "No changes to commit."
else
git commit -m "Auto-format code [skip actions]"
git push origin ${{ github.ref }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GX_TOKEN }}