Spaces:
Running
Running
GitHub actions: actually commit files to PR after formatting
Browse files- .github/workflows/ci.yml +14 -0
.github/workflows/ci.yml
CHANGED
|
@@ -33,3 +33,17 @@ jobs:
|
|
| 33 |
- name: Run black
|
| 34 |
run: |
|
| 35 |
black --line-length=120 .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
- name: Run black
|
| 34 |
run: |
|
| 35 |
black --line-length=120 .
|
| 36 |
+
|
| 37 |
+
- name: Configure Git
|
| 38 |
+
run: |
|
| 39 |
+
git config user.name "GitHub Actions"
|
| 40 |
+
git config user.email "actions@github.com"
|
| 41 |
+
|
| 42 |
+
- name: Check if any files were modified
|
| 43 |
+
run: |
|
| 44 |
+
git diff --exit-code || git commit -am "Auto-format code with isort and black"
|
| 45 |
+
|
| 46 |
+
- name: Push changes
|
| 47 |
+
if: success()
|
| 48 |
+
run: |
|
| 49 |
+
git push origin HEAD:${{ github.head_ref }}
|