Skip to content

Commit 70170de

Browse files
Update black.yml
1 parent 1610be1 commit 70170de

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/black.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
name: Lint
2-
1+
name: black-action
32
on: [push, pull_request]
4-
53
jobs:
6-
lint:
4+
linter_name:
5+
name: runner / black
76
runs-on: ubuntu-latest
87
steps:
98
- uses: actions/checkout@v4
10-
- uses: psf/black@stable
9+
- name: Check files using the black formatter
10+
uses: rickstaa/action-black@v1
11+
id: action_black
1112
with:
12-
options: ""
13-
version: "~= 22.0"
13+
black_args: "."
14+
- name: Create Pull Request
15+
if: steps.action_black.outputs.is_formatted == 'true'
16+
uses: peter-evans/create-pull-request@v6
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
title: "Format Python code with psf/black push"
20+
commit-message: ":art: Format Python code with psf/black"
21+
body: |
22+
There appear to be some python formatting errors in ${{ github.sha }}. This pull request
23+
uses the [psf/black](https://github.com/psf/black) formatter to fix these issues.
24+
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
25+
branch: actions/black

0 commit comments

Comments
 (0)