Skip to content

Commit 4e3dfa0

Browse files
committed
Rename main.yml to pull_request.yml, add push.yml
Lintly-Flake8 only works for PRs, so I had to split the workflows into 2 different files. I also added the secrets.GITHUB_TOKEN because that might be needed based on the action's documentation
1 parent ecae14c commit 4e3dfa0

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
name: Python Style
1+
# Uses https://github.com/marketplace/actions/lintly-flake8?version=v1.0
2+
name: Python Style (PR)
23

34
on:
4-
push:
5-
branches: [ master ]
65
pull_request:
76
branches: [ master ]
87

@@ -16,9 +15,8 @@ jobs:
1615
uses: actions/setup-python@v2
1716
with:
1817
python-version: '3.x'
19-
# - name: Lint with flake8
20-
# run: |
21-
# pip install flake8
22-
# flake8 .
2318
- name: Lintly-Flake8
24-
uses: grantmcconnaughey/lintly-flake8-github-action@v1.0
19+
uses: grantmcconnaughey/lintly-flake8-github-action@v1.0
20+
with:
21+
# The GitHub API token to create reviews with
22+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/push.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Python Style (Push)
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
check-style:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.x'
17+
- name: Lint with flake8
18+
run: |
19+
pip install flake8
20+
flake8 .

0 commit comments

Comments
 (0)