@@ -42,42 +42,11 @@ jobs:
42
42
- run : |
43
43
cat diff_*.txt | head -c 30000 | tee fulldiff.txt
44
44
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
-
77
45
- name : Post comment
46
+ id : post-comment
78
47
uses : actions/github-script@v3
79
48
with :
80
- github-token : ${{secrets.GITHUB_TOKEN}}
49
+ github-token : ${{ secrets.GITHUB_TOKEN }}
81
50
script : |
82
51
const fs = require('fs')
83
52
const data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
99
68
body
100
69
})
101
70
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