-
-
Notifications
You must be signed in to change notification settings - Fork 101
35 lines (29 loc) · 965 Bytes
/
black.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
# This is a basic workflow to help you get started with Actions
name: Lint with Black
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ "4.x.y.z"]
paths:
- '**.py'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint code
uses: psf/black@stable
with:
options: "-l 120 -t py37"
- name: Commit cleaned code
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -am "Python code is blacked" --author="TheYOSH <[email protected]>" || true
git push -f