Skip to content

Commit

Permalink
fix: log if comment can't be created
Browse files Browse the repository at this point in the history
  • Loading branch information
whilefoo committed Sep 12, 2024
1 parent 41ee9e1 commit ba98cb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sdk/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ async function postComment(context: Context, error: LogReturn) {
issue_number: context.payload.issue.number,
body: `${error.logMessage.diff}\n<!--\n${getGithubWorkflowRunUrl()}\n${sanitizeMetadata(error.metadata)}\n-->`,
});
} else {
context.logger.info("Cannot post comment because issue is not found in the payload");
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/sdk/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,7 @@ async function postComment(context: Context, error: LogReturn) {
issue_number: context.payload.issue.number,
body: `${error.logMessage.diff}\n<!--\n${sanitizeMetadata(error.metadata)}\n-->`,
});
} else {
context.logger.info("Cannot post comment because issue is not found in the payload");
}
}

0 comments on commit ba98cb6

Please sign in to comment.