Skip to content

Commit

Permalink
Github Actions: fail the pr if duplication found (#11744)
Browse files Browse the repository at this point in the history
* Github Actions: fail the pr if duplication found

* Update jscpd.yml

* Update jscpd.yml
  • Loading branch information
patmmccann authored Jun 9, 2024
1 parent ba94bca commit 1fc387a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/jscpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Check if filtered jscpd report exists
id: check_filtered_report
run: |
if [ -s ./filtered-jscpd-report.json ]; then
if [ $(wc -l < ./filtered-jscpd-report.json) -gt 1 ]; then
echo "filtered_report_exists=true" >> $GITHUB_ENV
else
echo "filtered_report_exists=false" >> $GITHUB_ENV
Expand Down Expand Up @@ -107,3 +107,9 @@ jobs:
issue_number: context.issue.number,
body: comment
});
- name: Fail if duplications are found
if: env.filtered_report_exists == 'true'
run: |
echo "Duplications found, failing the check."
exit 1

0 comments on commit 1fc387a

Please sign in to comment.