File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : autopep8
2
+ on : pull_request
3
+ jobs :
4
+ autopep8 :
5
+ # Check if the PR is not raised by this workflow and is not from a fork
6
+ if : startsWith(github.head_ref, 'autopep8-patches') == false && github.event.pull_request.head.repo.full_name == github.repository
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - name : Set up Python 3
10
+ uses : actions/setup-python@v2
11
+ with :
12
+ python-version : 3
13
+ - name : Checkout Code
14
+ uses : actions/checkout@v2
15
+ with :
16
+ ref : ${{ github.head_ref }}
17
+ - name : Install dependencies
18
+ run : |
19
+ python -m pip install --upgrade pip
20
+ pip install setuptools wheel flake8 pytest
21
+ - name : autopep8
22
+ id : autopep8
23
+ uses : peter-evans/autopep8@v1
24
+ with :
25
+ args : --exit-code --recursive --in-place --aggressive --aggressive .
26
+ - name : Set autopep8 branch name
27
+ id : vars
28
+ run : echo ::set-output name=branch-name::"autopep8-patches/$GITHUB_HEAD_REF"
29
+ - name : Create Pull Request
30
+ if : steps.autopep8.outputs.exit-code == 2
31
+ uses : peter-evans/create-pull-request@v2
32
+ with :
33
+ commit-message : autopep8 action fixes
34
+ committer :
Carmine Scarpitta <[email protected] >
35
+ title : Fixes by autopep8 action
36
+ body : This is an auto-generated PR with fixes by autopep8.
37
+ labels : autopep8, automated pr
38
+ reviewers : cscarpitta
39
+ branch : ${{ steps.vars.outputs.branch-name }}
40
+ - name : Fail if autopep8 made changes
41
+ if : steps.autopep8.outputs.exit-code == 2
42
+ run : exit 1
You can’t perform that action at this time.
0 commit comments