From 19e9c9917cae660cee140d1282d2dc69ff6da95a Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Mon, 10 Jun 2024 09:47:41 -0400 Subject: [PATCH] Github Actions: fix commenting on pr's from forks (#11751) * Update jscpd.yml * Update jscpd.yml --- .github/workflows/jscpd.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jscpd.yml b/.github/workflows/jscpd.yml index 51b7a7c6123..ab3eeebc81d 100644 --- a/.github/workflows/jscpd.yml +++ b/.github/workflows/jscpd.yml @@ -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')); @@ -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,