Skip to content

Commit

Permalink
Update jscpd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann authored Jun 8, 2024
1 parent 2962c29 commit 80dc04e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/jscpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ jobs:
grep -E '\.js$' changed_files.txt > js_files.txt || true
- name: Run jscpd on changed files
if: success()
id: run-jscpd
if: success() && -s js_files.txt
run: |
if [ -s js_files.txt ]; then
jscpd --files $(cat js_files.txt | tr '\n' ',') --threshold 1 --min-tokens 50 --reporters json --output jscpd-report.json
else
echo "No JavaScript files changed."
fi
jscpd --files $(cat js_files.txt | tr '\n' ',') --threshold 1 --min-tokens 50 --reporters json --output jscpd-report.json
- name: Create empty report if no JS files
if: success() && !steps.run-jscpd.outputs.success
run: echo '{}' > jscpd-report.json

- name: Upload jscpd report
if: always()
Expand Down

0 comments on commit 80dc04e

Please sign in to comment.