@@ -24,7 +24,8 @@ permissions:
2424jobs :
2525 download :
2626 runs-on : ubuntu-latest
27- if : ${{ github.event.workflow_run.conclusion == 'success' }}
27+ # FIXME(feature freeze): Make sure to remove that last part after the feature freeze is over
28+ if : ${{ github.event.workflow_run.conclusion == 'success' && ! contains(github.event.pull_request.labels.*.name, 'A-new-lint') }}
2829 steps :
2930 - name : Download artifact
3031 uses : actions/download-artifact@v4
@@ -40,54 +41,54 @@ jobs:
4041 script : |
4142 const fs = require("fs");
4243 const assert = require("assert/strict");
43-
44+
4445 function validateName(s) {
4546 assert.match(s, /^[a-z0-9_:]+$/);
4647 return s;
4748 }
48-
49+
4950 function validateInt(i) {
5051 assert.ok(Number.isInteger(i));
5152 return i;
5253 }
53-
54+
5455 function tryReadSummary() {
5556 try {
5657 return JSON.parse(fs.readFileSync("untrusted/summary.json"));
5758 } catch {
5859 return null;
5960 }
6061 }
61-
62+
6263 const prNumber = parseInt(fs.readFileSync("untrusted/pr.txt"), 10);
6364 core.exportVariable("PR", prNumber.toString());
64-
65+
6566 const untrustedSummary = tryReadSummary();
6667 if (!Array.isArray(untrustedSummary)) {
6768 return;
6869 }
69-
70+
7071 let summary = `Lintcheck changes for ${context.payload.workflow_run.head_sha}
7172
7273 | Lint | Added | Removed | Changed |
7374 | ---- | ----: | ------: | ------: |
7475 `;
75-
76+
7677 for (const untrustedRow of untrustedSummary) {
7778 const name = validateName(untrustedRow.name);
78-
79+
7980 const added = validateInt(untrustedRow.added);
8081 const removed = validateInt(untrustedRow.removed);
8182 const changed = validateInt(untrustedRow.changed);
8283
8384 const id = name.replace("clippy::", "user-content-").replaceAll("_", "-");
8485 const url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${context.payload.workflow_run.id}#${id}`;
85-
86+
8687 summary += `| [\`${name}\`](${url}) | ${added} | ${removed} | ${changed} |\n`;
8788 }
88-
89+
8990 summary += "\nThis comment will be updated if you push new changes";
90-
91+
9192 fs.writeFileSync("summary.md", summary);
9293
9394 - name : Create/update comment
0 commit comments