mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-04 01:42:26 +03:00
51 lines
1.3 KiB
YAML
51 lines
1.3 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:
|
|
check_access:
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- name: Check annotation access
|
|
if: ${{ github.actor != 'AthanasiusTEST' }}
|
|
run: exit 1
|
|
|
|
flake8_annotate:
|
|
needs: check_access
|
|
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.
|
|
PYFILES=$(git diff --name-only "refs/remotes/origin/${BASE_REF}" -- | egrep '.py$' || true)
|
|
echo "::set-env name=PYFILES::${PYFILES}"
|
|
|
|
- name: Set up Python 3.7
|
|
if: ${{ env.PYFILES != '' }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Annotate with Flake8
|
|
if: ${{ env.PYFILES != '' }}
|
|
uses: "tayfun/flake8-your-pr@master"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|