-
Notifications
You must be signed in to change notification settings - Fork 21
feat(ci): unconditionally hide prior formatting PR comments, and only post a new one in case of failure #1425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
verytactical
merged 25 commits into
main
from
closes-1284-silence,comments,a-check-is-speaking
Dec 1, 2025
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e5c5c3e
feat(ci): unconditionally hide prior formatting PR comments, and only…
novusnota 5f78a67
let's fail the formatter
novusnota 4ff28e7
1
novusnota 8f7fb60
1
novusnota f861ce5
1
novusnota 793e157
1
novusnota 7db37df
1
novusnota 93e69dc
1
novusnota f8aa841
1
novusnota f0c55be
1
novusnota 80146e8
1
novusnota b30764d
1
novusnota b002656
1
novusnota fcb0eec
1
novusnota fe05f7f
1
novusnota 3160523
1
novusnota 3db3dd5
lookin' finger lickin' good
novusnota 2c47997
and now reverting the formatting back
novusnota cc15513
Merge branch 'main' into closes-1284-silence,comments,a-check-is-spea…
novusnota afc0205
Merge branch 'main' into closes-1284-silence,comments,a-check-is-spea…
novusnota 9adbb82
try { place the CI script outside of yaml file } catch (err) { throw …
novusnota 114479d
let's break it, temporarily
novusnota 5667d57
here comes the fix — comments, begone!
novusnota 6876594
Merge branch 'main' into closes-1284-silence,comments,a-check-is-spea…
novusnota 4a62f2e
JavaScript!
novusnota File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| export async function hidePriorCommentsWithPrefix({ | ||
| github, // injected by GitHub | ||
| context, // injected by GitHub | ||
| exec, // injected by GitHub | ||
| prefix = '', | ||
| resolved = true, | ||
| user = 'github-actions[bot]', | ||
| }) { | ||
| const comments = await github.rest.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| }); | ||
| for (const comment of comments.data) { | ||
| const isHidden = (await github.graphql(` | ||
| query($nodeId: ID!) { | ||
| node(id: $nodeId) { | ||
| ... on IssueComment { | ||
| isMinimized | ||
| } | ||
| } | ||
| } | ||
| `, { nodeId: comment.node_id }))?.node?.isMinimized; | ||
| await exec.exec('sleep 0.5s'); | ||
| if (isHidden) { continue; } | ||
| if ( | ||
| comment.user.login === user && | ||
| comment.body.startsWith(prefix) | ||
| ) { | ||
| console.log('Comment node_id:', comment.node_id); | ||
| console.log(await github.graphql(` | ||
| mutation($subjectId: ID!, $classifier: ReportedContentClassifiers!) { | ||
| minimizeComment(input: { | ||
| subjectId: $subjectId, | ||
| classifier: $classifier | ||
| }) { | ||
| minimizedComment { | ||
| isMinimized | ||
| minimizedReason | ||
| } | ||
| } | ||
| } | ||
| `, { | ||
| subjectId: comment.node_id, | ||
| classifier: resolved ? 'RESOLVED' : 'OUTDATED', | ||
| })); | ||
| await exec.exec('sleep 0.5s'); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export async function createComment({ | ||
| github, // injected by GitHub | ||
| context, // injected by GitHub | ||
| exec, // injected by GitHub | ||
| body = '', | ||
| }) { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: body, | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.