Skip to content

Commit

Permalink
chore(commenting): log warning if successComment or failComment is us…
Browse files Browse the repository at this point in the history
…ed for disabling these
  • Loading branch information
JonasSchubert committed Jun 20, 2024
1 parent b998ee2 commit 83037d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | - |

Expand Down
2 changes: 2 additions & 0 deletions lib/fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions lib/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 83037d0

Please sign in to comment.