mirror of
https://github.com/dessant/lock-threads.git
synced 2026-03-13 01:27:03 -04:00
fix: ignore error when commenting on issue converted to discussion
Closes #24.
This commit is contained in:
14
src/index.js
14
src/index.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user