Skip to content

Commit a713f7b

Browse files
committed
remove comment functionality
1 parent 38468ae commit a713f7b

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

.github/workflows/node.js.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -103,31 +103,6 @@ jobs:
103103
name: filtered-jscpd-report
104104
path: ./filtered-jscpd-report.json
105105

106-
- name: Post GitHub comment
107-
if: env.filtered_report_exists == 'true'
108-
uses: actions/github-script@v7
109-
with:
110-
script: |
111-
const fs = require('fs');
112-
const filteredReport = JSON.parse(fs.readFileSync('filtered-jscpd-report.json', 'utf8'));
113-
let comment = "Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:\n\n";
114-
function link(dup) {
115-
return `https://github.com/${{ github.event.repository.full_name }}/blob/${{ github.event.pull_request.head.sha }}/${dup.name}#L${dup.start + 1}-L${dup.end - 1}`
116-
}
117-
filteredReport.forEach(duplication => {
118-
const firstFile = duplication.firstFile;
119-
const secondFile = duplication.secondFile;
120-
const lines = duplication.lines;
121-
comment += `- [\`${firstFile.name}\`](${link(firstFile)}) has ${lines} duplicated lines with [\`${secondFile.name}\`](${link(secondFile)})\n`;
122-
});
123-
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. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀";
124-
github.rest.issues.createComment({
125-
owner: context.repo.owner,
126-
repo: context.repo.repo,
127-
issue_number: context.issue.number,
128-
body: comment
129-
});
130-
131106
- name: Fail if duplications are found
132107
if: env.filtered_report_exists == 'true'
133108
run: |

0 commit comments

Comments
 (0)