1 parent 8ea12d8 commit 8ad7dd7Copy full SHA for 8ad7dd7
1 file changed
.github/workflows/ruff-format-pr.yml
@@ -0,0 +1,27 @@
1
+name: Format with Ruff
2
+
3
+on:
4
+ pull_request:
5
+ branches: [ main ]
6
7
+jobs:
8
+ format:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ ref: ${{ github.head_ref }} # Nécessaire pour modifier la branche de la PR
14
15
+ - uses: astral-sh/ruff-action@v1
16
17
+ args: --format-only # Formatage uniquement (sans --fix)
18
+ change-directory: . # Optionnel : cible le répertoire racine
19
20
+ - name: Commit changes
21
+ if: success() && steps.ruff.outputs.changes == 'true'
22
+ run: |
23
+ git config --global user.name "GitHub Actions"
24
+ git config --global user.email "actions@github.com"
25
+ git add .
26
+ git commit -m "Format code with Ruff"
27
+ git push
0 commit comments