Skip to content

Commit 872c03d

Browse files
authored
Sync mypy_primer_comment with typeshed (#12136)
1 parent 1ccefbd commit 872c03d

File tree

1 file changed

+10
-33
lines changed

1 file changed

+10
-33
lines changed

.github/workflows/mypy_primer_comment.yml

+10-33
Original file line numberDiff line numberDiff line change
@@ -42,42 +42,11 @@ jobs:
4242
- run: |
4343
cat diff_*.txt | head -c 30000 | tee fulldiff.txt
4444
45-
# Based on https://github.com/kanga333/comment-hider
46-
- name: Hide old comments
47-
uses: actions/github-script@v3
48-
with:
49-
github-token: ${{secrets.GITHUB_TOKEN}}
50-
script: |
51-
const fs = require('fs')
52-
53-
const response = await github.issues.listComments({
54-
issue_number: fs.readFileSync("pr_number.txt", { encoding: "utf8" }),
55-
owner: context.repo.owner,
56-
repo: context.repo.repo,
57-
})
58-
const botCommentIds = response.data
59-
.filter(comment => comment.user.login === 'github-actions[bot]')
60-
.map(comment => comment.node_id)
61-
62-
for (const id of botCommentIds) {
63-
const resp = await github.graphql(`
64-
mutation {
65-
minimizeComment(input: {classifier: OUTDATED, subjectId: "${id}"}) {
66-
minimizedComment {
67-
isMinimized
68-
}
69-
}
70-
}
71-
`)
72-
if (resp.errors) {
73-
throw new Error(resp.errors)
74-
}
75-
}
76-
7745
- name: Post comment
46+
id: post-comment
7847
uses: actions/github-script@v3
7948
with:
80-
github-token: ${{secrets.GITHUB_TOKEN}}
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
8150
script: |
8251
const fs = require('fs')
8352
const data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
@@ -99,3 +68,11 @@ jobs:
9968
body
10069
})
10170
return prNumber
71+
72+
- name: Hide old comments
73+
# v0.3.0
74+
uses: kanga333/comment-hider@bbdf5b562fbec24e6f60572d8f712017428b92e0
75+
with:
76+
github_token: ${{ secrets.GITHUB_TOKEN }}
77+
leave_visible: 1
78+
issue_number: ${{ steps.post-comment.outputs.result }}

0 commit comments

Comments
 (0)