Skip to content

Commit 3ab1377

Browse files
committed
fix: JS syntax error
1 parent e963d01 commit 3ab1377

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/deploy-chatbot.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,19 @@ jobs:
9393
${message}`);
9494
return { comment_id: 10 } // arbitraty mocked comment number;
9595
} else {
96-
github.rest.issues.createComment({
97-
owner: context.repo.owner,
98-
repo: context.repo.repo,
99-
issue_number: prNumber,
100-
body: message,
101-
});
102-
console.log(`Comment REST returned data: ${JSON.stringify(comment, null, 2)}`);
103-
return { "comment_id": comment.data.id };
96+
let comment = {};
97+
try {
98+
comment = await github.rest.issues.createComment({
99+
owner: context.repo.owner,
100+
repo: context.repo.repo,
101+
issue_number: prNumber,
102+
body: message,
103+
});
104+
return { "comment_id": comment.data.id };
105+
} catch (ex) {
106+
console.log("Failed to POST the comment on the PR to notify the user due to =[> " + ex + "]");
107+
return { "comment_id": null };
108+
}
104109
}
105110
106111
# TODO: from here, isolate them in independent workflows

0 commit comments

Comments
 (0)