Skip to content

Commit 5e6b26d

Browse files
committed
fix: add logging for release comments
1 parent 46d1d14 commit 5e6b26d

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,17 @@ jobs:
295295
}
296296
297297
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
298-
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
298+
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
299+
console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`)
300+
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
299301
300302
for (const comment of releaseComments) {
303+
console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`)
301304
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
302305
}
303306
304307
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
305-
await github.rest.issues.createComment({
308+
await github.rest.issues.createComment({
306309
owner,
307310
repo,
308311
issue_number,

lib/content/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,17 @@ jobs:
143143
}
144144
145145
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
146-
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
146+
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
147+
console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`)
148+
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
147149
148150
for (const comment of releaseComments) {
151+
console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`)
149152
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
150153
}
151154
152155
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
153-
await github.rest.issues.createComment({
156+
await github.rest.issues.createComment({
154157
owner,
155158
repo,
156159
issue_number,

tap-snapshots/test/apply/source-snapshots.js.test.cjs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,14 +1049,17 @@ jobs:
10491049
}
10501050
10511051
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
1052-
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
1052+
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
1053+
console.log(\`Found comments: \${JSON.stringify(comments, null, 2)}\`)
1054+
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
10531055
10541056
for (const comment of releaseComments) {
1057+
console.log(\`Release comment: \${JSON.stringify(comment, null, 2)}\`)
10551058
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
10561059
}
10571060
10581061
const runUrl = \`https://github.com/\${owner}/\${repo}/actions/runs/\${runId}\`
1059-
await github.rest.issues.createComment({
1062+
await github.rest.issues.createComment({
10601063
owner,
10611064
repo,
10621065
issue_number,
@@ -2631,14 +2634,17 @@ jobs:
26312634
}
26322635
26332636
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
2634-
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
2637+
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
2638+
console.log(\`Found comments: \${JSON.stringify(comments, null, 2)}\`)
2639+
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
26352640
26362641
for (const comment of releaseComments) {
2642+
console.log(\`Release comment: \${JSON.stringify(comment, null, 2)}\`)
26372643
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
26382644
}
26392645
26402646
const runUrl = \`https://github.com/\${owner}/\${repo}/actions/runs/\${runId}\`
2641-
await github.rest.issues.createComment({
2647+
await github.rest.issues.createComment({
26422648
owner,
26432649
repo,
26442650
issue_number,
@@ -4056,14 +4062,17 @@ jobs:
40564062
}
40574063
40584064
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
4059-
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
4065+
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
4066+
console.log(\`Found comments: \${JSON.stringify(comments, null, 2)}\`)
4067+
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
40604068
40614069
for (const comment of releaseComments) {
4070+
console.log(\`Release comment: \${JSON.stringify(comment, null, 2)}\`)
40624071
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
40634072
}
40644073
40654074
const runUrl = \`https://github.com/\${owner}/\${repo}/actions/runs/\${runId}\`
4066-
await github.rest.issues.createComment({
4075+
await github.rest.issues.createComment({
40674076
owner,
40684077
repo,
40694078
issue_number,

0 commit comments

Comments
 (0)