mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-22 03:06:59 +03:00
And make both the 'Annotate with Flake8' and 'Set up Python 3.7' steps dependent on it.
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
# This workflow will:
|
|
#
|
|
# install Python dependencies
|
|
# Run flake8 to add annotations to the PR
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
name: PR-annotate-flake8
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ develop ]
|
|
|
|
jobs:
|
|
flake8_annotate:
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check for PY files
|
|
env:
|
|
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$'
|
|
|
|
- name: Set up Python 3.7
|
|
if: ${{ success() }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Annotate with Flake8
|
|
if: ${{ success() }}
|
|
uses: "tayfun/flake8-your-pr@master"
|
|
needs:
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|