File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments