mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
Only run flake8 annotation if there are *.py files in diff
This commit is contained in:
parent
629a3461f6
commit
3ae0b83ac2
46
.github/workflows/pr-annotate-with-flake8.yml
vendored
46
.github/workflows/pr-annotate-with-flake8.yml
vendored
@ -11,19 +11,43 @@ on:
|
||||
branches: [ develop ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
check_py:
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Annotate with Flake8
|
||||
uses: "tayfun/flake8-your-pr@master"
|
||||
|
||||
- name: Check for PY files
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BASE_REF: ${{github.base_ref}}
|
||||
run: |
|
||||
# Will exit with non-zero if no filenames ending in ".py" are in
|
||||
# the diff.
|
||||
git diff --name-only "refs/remotes/origin/${BASE_REF}" -- | egrep -v '.py$'
|
||||
|
||||
flake8_annotate:
|
||||
- name: Annotate PR with Flake8
|
||||
needs: check_py
|
||||
# Only run if the check_py succeeded
|
||||
if: ${{ success() }}
|
||||
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.7
|
||||
|
||||
- name: Annotate with Flake8
|
||||
uses: "tayfun/flake8-your-pr@master"
|
||||
needs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user