Skip to content

Commit

Permalink
Github Actions: fix commenting on pr's from forks (prebid#11751)
Browse files Browse the repository at this point in the history
* Update jscpd.yml

* Update jscpd.yml
  • Loading branch information
patmmccann authored Jun 10, 2024
1 parent d215211 commit 19e9c99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/jscpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
if: env.filtered_report_exists == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.PAT_TOKEN }}
script: |
const fs = require('fs');
const filteredReport = JSON.parse(fs.readFileSync('filtered-jscpd-report.json', 'utf8'));
Expand All @@ -100,7 +101,7 @@ jobs:
const lines = duplication.lines;
comment += `- \`${firstFile}\` has ${lines} duplicated lines with \`${secondFile}\`\n`;
});
comment += "\nReducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Keep up the great work! 🚀";
comment += "\nReducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. Keep up the great work! 🚀";
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down

0 comments on commit 19e9c99

Please sign in to comment.