From 83037d09a6907eb378727a4e929fa1daa6dc1110 Mon Sep 17 00:00:00 2001 From: Jonas Schubert Date: Thu, 20 Jun 2024 21:09:49 +0200 Subject: [PATCH] chore(commenting): log warning if successComment or failComment is used for disabling these --- README.md | 6 +++--- lib/fail.js | 2 ++ lib/success.js | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 129df9f8..f115a1af 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,9 @@ If you need to bypass the proxy for some hosts, configure the `NO_PROXY` environ | `gitlabApiPathPrefix` | The GitLab API prefix. | `GL_PREFIX` or `GITLAB_PREFIX` environment variable or CI provided environment variables if running on [GitLab CI/CD](https://docs.gitlab.com/ee/ci) or `/api/v4`. | | `assets` | An array of files to upload to the release. See [assets](#assets). | - | | `milestones` | An array of milestone titles to associate to the release. See [GitLab Release API](https://docs.gitlab.com/ee/api/releases/#create-a-release). | - | -| `successComment` | The comment to add to each Issue and Merge Request resolved by the release. Set to false to disable commenting. See [successComment](#successComment). | :tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitLab release](gitlab_release_url) | -| `failComment` | The content of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. See [failComment](#failcomment). | Friendly message with links to **semantic-release** documentation and support, with the list of errors that caused the release to fail. | -| `failTitle` | The title of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. | `The automated release is failing 🚨` | +| `successComment` | The comment to add to each Issue and Merge Request resolved by the release. See [successComment](#successComment). | :tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitLab release](gitlab_release_url) | +| `failComment` | The content of the issue created when a release fails. See [failComment](#failcomment). | Friendly message with links to **semantic-release** documentation and support, with the list of errors that caused the release to fail. | +| `failTitle` | The title of the issue created when a release fails. | `The automated release is failing 🚨` | | `labels` | The [labels](https://docs.gitlab.com/ee/user/project/labels.html#labels) to add to the issue created when a release fails. Set to `false` to not add any label. Labels should be comma-separated as described in the [official docs](https://docs.gitlab.com/ee/api/issues.html#new-issue), e.g. `"semantic-release,bot"`. | `semantic-release` | | `assignee` | The [assignee](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#assignee) to add to the issue created when a release fails. | - | diff --git a/lib/fail.js b/lib/fail.js index d2706236..18ac6fa6 100644 --- a/lib/fail.js +++ b/lib/fail.js @@ -24,6 +24,8 @@ export default async (pluginConfig, context) => { if (failComment === false || failTitle === false) { logger.log("Skip issue creation."); + logger.error(`Disabling failure reporting should be done using 'failCommentCondition'. +Using 'false' for 'failComment' or 'failTitle' is deprecated and will be removed in a future major version!`); } else { const encodedFailTitle = encodeURIComponent(failTitle); const description = failComment ? template(failComment)({ branch, errors }) : getFailComment(branch, errors); diff --git a/lib/success.js b/lib/success.js index bc697b90..3cce4204 100644 --- a/lib/success.js +++ b/lib/success.js @@ -22,6 +22,8 @@ export default async (pluginConfig, context) => { if (successComment === false) { logger.log("Skip commenting on issues and pull requests."); + logger.error(`Disabling commenting on issues and pull requests should be done using 'successCommentCondition'. +Using 'false' for 'successComment' is deprecated and will be removed in a future major version!`); } else { const releaseInfos = releases.filter((release) => Boolean(release.name)); try {