feat: disable comment if dry-run

This commit is contained in:
Andrea Lamparelli 2024-04-10 21:48:29 +02:00
parent 1f09f3d7ea
commit 7c420531c8
4 changed files with 53 additions and 7 deletions

2
dist/cli/index.js vendored
View file

@ -1557,7 +1557,7 @@ class Runner {
}
catch (error) {
this.logger.error(`Something went wrong backporting to ${pr.base}: ${error}`);
if (configs.errorNotification.enabled && configs.errorNotification.message.length > 0) {
if (!configs.dryRun && configs.errorNotification.enabled && configs.errorNotification.message.length > 0) {
// notify the failure as comment in the original pull request
const comment = (0, runner_util_1.injectError)(configs.errorNotification.message, error);
gitApi.createPullRequestComment(configs.originalPullRequest.url, comment);