Skip to content

Commit 4bac7c6

Browse files
authored
Merge branch 'main' into drop-cpp20
2 parents cc89a84 + c462c66 commit 4bac7c6

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

dist/index.js

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { count } from "console";
21
import { readdirSync, readFileSync } from "fs";
32
import { App } from "octokit";
43

@@ -165,6 +164,25 @@ body ??= generateTable(matrix);
165164
console.log("body is", body);
166165

167166
if (body) {
167+
console.log("outdates previous comments");
168+
const { data: comments } = await octokit.rest.issues.listComments({
169+
owner,
170+
repo,
171+
issue_number: pull_request_number,
172+
});
173+
for (const comment of comments) {
174+
if (comment.user?.login === "cppwarningnotifier[bot]") {
175+
console.log("self-commented comment found");
176+
await octokit.graphql(`
177+
mutation {
178+
minimizeComment(input: { subjectId: "${comment.node_id}", classifier: OUTDATED }) {
179+
clientMutationId
180+
}
181+
}
182+
`);
183+
}
184+
}
185+
168186
console.log("leaving comment");
169187
octokit.rest.issues.createComment({
170188
owner,

0 commit comments

Comments
 (0)