1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-16 09:10:35 +03:00

Don't run flake8_annotate if no access

This is using github.actor and checking who it is.  If they're not
someone who should have access then use a run with 'exit 1' to fail the
check job.

Then flake8_annotate job needs check_access to have succeeded.

This *will* flag the workflow action as failed if no access, hopefully
it will be obvious why.

Using 'AthanasiusTEST' so it fails for me on this commit/push.
This commit is contained in:
Athanasius 2020-07-28 17:11:16 +01:00
parent dc58d0f3af
commit 6c9bffcaa0

View File

@ -11,18 +11,23 @@ on:
branches: [ develop ]
jobs:
check_access:
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
if: ${{ github.actor == 'Athanasius' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for PY files
if: ${{ github.actor == 'Athanasius' }}
env:
BASE_REF: ${{github.base_ref}}
run: |
@ -32,14 +37,12 @@ jobs:
echo "::set-env name=PYFILES::${PYFILES}"
- name: Set up Python 3.7
if: ${{ github.actor == 'Athanasius' }}
if: ${{ env.PYFILES != '' }}
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Annotate with Flake8
if: ${{ github.actor == 'Athanasius' }}
if: ${{ env.PYFILES != '' }}
uses: "tayfun/flake8-your-pr@master"
env: