-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
maintenanceAn improvement to codebase maintainabilityAn improvement to codebase maintainability
Description
When publishing another pre-release, @radashi-bot should not comment on PRs that already had their first pre-release. But it should comment when a stable release is published (which it already does).
If anyone has time to look into this, here's the related code:
radashi/scripts/publish-version/src/publishVersion.ts
Lines 368 to 398 in 53f3e0e
| // Find and delete existing comment by radashi-bot | |
| const existingComments = await octokit.issues.listComments({ | |
| owner: 'radashi-org', | |
| repo: 'radashi', | |
| issue_number: +prNumber, | |
| per_page: 100, | |
| }) | |
| const botComment = existingComments.data.find( | |
| comment => | |
| comment.user && | |
| (comment.user.login === 'radashi-bot' || | |
| comment.user.login === 'github-actions[bot]') && | |
| comment.body?.includes('published to NPM'), | |
| ) | |
| if (botComment) { | |
| await octokit.issues.deleteComment({ | |
| owner: 'radashi-org', | |
| repo: 'radashi', | |
| comment_id: botComment.id, | |
| }) | |
| } | |
| // Create new comment | |
| await octokit.issues.createComment({ | |
| owner: 'radashi-org', | |
| repo: 'radashi', | |
| issue_number: +prNumber, | |
| body, | |
| }) |
Metadata
Metadata
Assignees
Labels
maintenanceAn improvement to codebase maintainabilityAn improvement to codebase maintainability