-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.51 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: check format
on:
push:
branches: [ main ]
paths:
- '**.py'
- '.github/workflows/black.yml'
pull_request:
branches: [ main ]
paths:
- '**.py'
- '.github/workflows/black.yml'
jobs:
black:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
name: black style
defaults:
run:
shell: bash
steps:
- uses: actions/[email protected]
- name: setting up python
uses: actions/[email protected]
with:
python-version-file: pyproject.toml
- name: check python formatting using black
uses: rickstaa/[email protected]
id: action_black
- name: creating pull request
if: steps.action_black.outputs.is_formatted == 'true' && github.head_ref == ''
uses: peter-evans/[email protected]
with:
commit-message: 'style(format): reformat with black'
title: 'style(format): reformat with black'
body: |
This pull requests deploys the new Python code style [black][1].
[1]: https://github.com/psf/black
labels: |
style
chore
black
branch: black
delete-branch: true
branch-suffix: short-commit-hash
- name: annotate diff changes using reviewdog
if: steps.action_black.outputs.is_formatted == 'true' && github.head_ref != ''
uses: reviewdog/[email protected]
with:
tool_name: blackfmt