mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
Try ENV var for passing presence of *.py files
This uses <https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#using-workflow-commands-to-access-toolkit-functions> to set PYFILES env var globally in the job, so should be testable in the following steps.
This commit is contained in:
parent
792583bfe1
commit
a93cfb5ed8
@ -26,16 +26,17 @@ jobs:
|
||||
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 '.py$'
|
||||
PYFILES=$(git diff --name-only "refs/remotes/origin/${BASE_REF}" -- | egrep '.py$')
|
||||
echo '::set-env name=PYFILES::${PYFILES}'
|
||||
|
||||
- name: Set up Python 3.7
|
||||
if: ${{ success() }}
|
||||
if: ${{ env.PYFILES != "" }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.7
|
||||
|
||||
- name: Annotate with Flake8
|
||||
if: ${{ success() }}
|
||||
if: ${{ env.PYFILES != "" }}
|
||||
uses: "tayfun/flake8-your-pr@master"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user