Skip to content

Commit

Permalink
fix: ignore error when commenting on issue converted to discussion
Browse files Browse the repository at this point in the history
Closes #24.
  • Loading branch information
dessant committed Aug 17, 2021
1 parent 1621939 commit 60d2a1a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/index.js
Expand Up @@ -46,10 +46,16 @@ class App {

if (lockComment) {
core.debug(`Commenting (${type}: ${issue.issue_number})`);
await this.client.rest.issues.createComment({
...issue,
body: lockComment
});
try {
await this.client.rest.issues.createComment({
...issue,
body: lockComment
});
} catch (err) {
if (!/cannot be modified.*discussion/i.test(err.message)) {
throw err;
}
}
}

if (lockLabels) {
Expand Down

0 comments on commit 60d2a1a

Please sign in to comment.