build: conditionally run fossa check if dependency files change (#9814)

This commit is contained in:
ʈᵃᵢ 2020-05-19 10:03:59 -07:00 committed by GitHub
parent 88dd2ddd56
commit 68832d2fa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 1 deletions

View File

@ -17,6 +17,24 @@ jobs:
- name: Generate fossa report
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
run: ./scripts/fossa.sh
run: |
set -eo pipefail
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename')
cat<<EOF
CHANGED FILES:
$FILES
EOF
if [[ "$FILES" =~ ^(.*package*\.json|.*requirements*\.txt)$ ]]; then
echo "Detected dependency changes... running fossa check"
./scripts/fossa.sh
else
echo "No dependency changes... skiping fossa check"
fi
shell: bash
- name: Run license check
run: ./scripts/check_license.sh