File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -339,6 +339,36 @@ jobs:
339339 comment-id : ${{ github.event.comment.id }}
340340 reactions : heart
341341
342+ - name : Minimize previous snapshot comments
343+ if : steps.version-packages.outputs.success == '1'
344+ uses : actions/github-script@v7
345+ with :
346+ github-token : ${{ secrets.CLERK_COOKIE_PAT }}
347+ script : |
348+ const { data: comments } = await github.rest.issues.listComments({
349+ owner: context.repo.owner,
350+ repo: context.repo.repo,
351+ issue_number: context.issue.number,
352+ per_page: 100,
353+ });
354+
355+ const snapshotComments = comments.filter(
356+ (comment) =>
357+ comment.body?.includes('the snapshot version command generated the following package versions')
358+ );
359+
360+ for (const comment of snapshotComments) {
361+ await github.graphql(`
362+ mutation MinimizeComment($id: ID!) {
363+ minimizeComment(input: { subjectId: $id, classifier: OUTDATED }) {
364+ minimizedComment {
365+ isMinimized
366+ }
367+ }
368+ }
369+ `, { id: comment.node_id });
370+ }
371+
342372 - name : Create snapshot release comment
343373 if : steps.version-packages.outputs.success == '1'
344374 uses : peter-evans/create-or-update-comment@v3.0.0
You can’t perform that action at this time.
0 commit comments