We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9cb24e commit 996f2bbCopy full SHA for 996f2bb
.github/workflows/pre-commit.yml
@@ -0,0 +1,24 @@
1
+name: pre-commit
2
+
3
+on: pull_request
4
5
+jobs:
6
+ black-format:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+ with:
11
+ ref: ${{ github.ref }}
12
+ - uses: actions/setup-python@v3
13
+ - name: Install uv
14
+ run: pip install uv
15
+ - name: Run black via uv
16
+ run: uvx black .
17
+ - name: Commit and push changes
18
+ if: !contains(github.event.head_commit.message , 'Apply black formatting')
19
+ run: |
20
+ git config --global user.name "github-actions[bot]"
21
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
22
+ git add .
23
+ git diff --cached --quiet || git commit -m "Apply black formatting"
24
+ git push origin HEAD:${{ github.head_ref }}
0 commit comments