Skip to content

Commit

Permalink
fix: add logging for release comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Feb 7, 2023
1 parent 46d1d14 commit 5e6b26d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -295,14 +295,17 @@ jobs:
}
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`)
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
for (const comment of releaseComments) {
console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`)
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
}
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
await github.rest.issues.createComment({
await github.rest.issues.createComment({
owner,
repo,
issue_number,
Expand Down
7 changes: 5 additions & 2 deletions lib/content/release.yml
Expand Up @@ -143,14 +143,17 @@ jobs:
}
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`)
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
for (const comment of releaseComments) {
console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`)
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
}
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
await github.rest.issues.createComment({
await github.rest.issues.createComment({
owner,
repo,
issue_number,
Expand Down
21 changes: 15 additions & 6 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Expand Up @@ -1049,14 +1049,17 @@ jobs:
}
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
console.log(\`Found comments: \${JSON.stringify(comments, null, 2)}\`)
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
for (const comment of releaseComments) {
console.log(\`Release comment: \${JSON.stringify(comment, null, 2)}\`)
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
}
const runUrl = \`https://github.com/\${owner}/\${repo}/actions/runs/\${runId}\`
await github.rest.issues.createComment({
await github.rest.issues.createComment({
owner,
repo,
issue_number,
Expand Down Expand Up @@ -2631,14 +2634,17 @@ jobs:
}
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
console.log(\`Found comments: \${JSON.stringify(comments, null, 2)}\`)
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
for (const comment of releaseComments) {
console.log(\`Release comment: \${JSON.stringify(comment, null, 2)}\`)
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
}
const runUrl = \`https://github.com/\${owner}/\${repo}/actions/runs/\${runId}\`
await github.rest.issues.createComment({
await github.rest.issues.createComment({
owner,
repo,
issue_number,
Expand Down Expand Up @@ -4056,14 +4062,17 @@ jobs:
}
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
console.log(\`Found comments: \${JSON.stringify(comments, null, 2)}\`)
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
for (const comment of releaseComments) {
console.log(\`Release comment: \${JSON.stringify(comment, null, 2)}\`)
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
}
const runUrl = \`https://github.com/\${owner}/\${repo}/actions/runs/\${runId}\`
await github.rest.issues.createComment({
await github.rest.issues.createComment({
owner,
repo,
issue_number,
Expand Down

0 comments on commit 5e6b26d

Please sign in to comment.