Skip to content

Commit cae7a3e

Browse files
authored
Merge pull request #364 from pillo79/license-fix2
scancode: skip processing if no new files found
2 parents e9522f8 + fa1fa33 commit cae7a3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/scancode.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,25 @@ jobs:
2424
for NEW_FILE in $(git diff --name-only --diff-filter=A origin/$GITHUB_BASE_REF..HEAD) ; do
2525
mkdir -p $(dirname "scancode-inputs/$NEW_FILE")
2626
cp "$NEW_FILE" "scancode-inputs/$NEW_FILE"
27+
echo 'NEW_FILES_FOUND=true' >> $GITHUB_ENV
2728
done
2829
2930
- name: Scan the code
3031
id: scancode
3132
uses: aboutcode-org/scancode-action@beta
33+
if: env.NEW_FILES_FOUND == 'true'
3234
with:
3335
check-compliance: true
3436
output-formats: json xlsx
3537

3638
- name: Get the report
3739
uses: actions/download-artifact@v4
40+
if: env.NEW_FILES_FOUND == 'true'
3841
with:
3942
name: scancode-outputs
4043

4144
- name: Process the report
45+
if: env.NEW_FILES_FOUND == 'true'
4246
run: |
4347
# the following will error on missing licenses or compliance issues
4448
extra/ci_license_checks.sh scancode-inputs/ results-*.json

0 commit comments

Comments
 (0)