Skip to content

Commit 246f4aa

Browse files
authored
Merge branch 'main' into chris/mobile-405-react-native-components-release
2 parents f8f0f76 + d824e69 commit 246f4aa

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)