message: build: conditionally run fossa check if dependency files change
diff: @@ -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
  