From 876b13d8d58b18b130b47c86e437291b284de212 Mon Sep 17 00:00:00 2001 From: Samuel Valdes Gutierrez Date: Thu, 11 Apr 2024 22:30:27 -0400 Subject: [PATCH] adding logic for comment in PR in edge case with error ChangesetFileMustNotExistWithSkipEntryOption Signed-off-by: Samuel Valdes Gutierrez --- src/utils/handlers.utils.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/handlers.utils.js b/src/utils/handlers.utils.js index 315bbef7..d6c42e5e 100644 --- a/src/utils/handlers.utils.js +++ b/src/utils/handlers.utils.js @@ -198,7 +198,15 @@ export const handleSkipEntry = async ( // For manual changeset creation, add failed label to PR and throw error else { console.error("Error processing 'skip' entry option in changelog"); - throw new ChangesetFileMustNotExistWithSkipEntryOption(prData.prNumber); + const error = new ChangesetFileMustNotExistWithSkipEntryOption(prData.prNumber); + const commentInput = error; + await handlePullRequestComment( + octokit, + prData, + commentInput, + "changeset-check-error" + ); + throw error; } }