fix: ignore error when commenting on issue converted to discussion

Closes #24.
This commit is contained in:
dessant
2021-08-17 10:53:26 +03:00
parent 1621939cec
commit 60d2a1a4be

View File

@@ -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) {