File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 12
12
steps :
13
13
- uses : actions/checkout@v4
14
14
with :
15
- ref : ${{ github.head_ref }}
15
+ fetch-depth : 0
16
16
17
17
- name : Set up Python
18
18
uses : actions/setup-python@v4
23
23
run : pip install black
24
24
25
25
- name : Run Black
26
+ id : black
27
+ continue-on-error : true
28
+ run : |
29
+ black --check bbox_visualizer/bbox_visualizer.py tests/test_bbox_visualizer.py
30
+ echo "has_changes=$?" >> $GITHUB_OUTPUT
31
+
32
+ - name : Format with Black if needed
33
+ if : steps.black.outputs.has_changes == '1'
26
34
run : black bbox_visualizer/bbox_visualizer.py tests/test_bbox_visualizer.py
27
35
28
36
- name : Create Pull Request
37
+ if : steps.black.outputs.has_changes == '1'
29
38
uses : peter-evans/create-pull-request@v5
30
39
with :
31
40
commit-message : " style: format code with Black"
35
44
36
45
This PR was automatically created by the Black formatting GitHub Action.
37
46
branch : format-code-with-black
38
- delete-branch : true
47
+ base : main
48
+ delete-branch : true
49
+ token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments