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
  • Loading branch information
dessant committed Oct 1, 2021
1 parent 17e0997 commit 450b16d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,16 @@ class App {
body: commentBody
});
} else {
await this.client.rest.issues.createComment({
...issue,
body: commentBody
});
try {
await this.client.rest.issues.createComment({
...issue,
body: commentBody
});
} catch (err) {
if (!/cannot be modified.*discussion/i.test(err.message)) {
throw err;
}
}
}
}
});
Expand Down

0 comments on commit 450b16d

Please sign in to comment.