From 4d1bb7a23bb5ace7eb4125bddf9ebefad48f2e7e Mon Sep 17 00:00:00 2001 From: Filipe Ferreira Date: Thu, 4 Jul 2024 12:55:48 +0100 Subject: [PATCH 1/2] fix: add GITLAB_COMMENT_CUSTOM_LINKS env variable --- README.md | 1 + src/comment.ts | 14 ++++++++++---- src/types.ts | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 46555b5c..034117b9 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ GITLAB_CI_USER_NAME # optional, username with accessibility t GITLAB_CI_USER_EMAIL # optional, default `gitlab[bot]@users.noreply.gitlab.com` GITLAB_COMMENT_TYPE # optional, type of the comment. defaults to `discussion`. can be set to `note` to not create a discussion instead of a thread GITLAB_COMMENT_DISCUSSION_AUTO_RESOLVE # optional, automatically resolve added discussion when changeset is present, if you want to always resolve the discussion, you should actually use `GITLAB_COMMENT_TYPE=note` instead, default `true` +GITLAB_COMMENT_CUSTOM_LINKS # optional, override the links content referenced in the cli bot comment GITLAB_ADD_CHANGESET_MESSAGE # optional, default commit message for adding changesets on GitLab Web UI DEBUG_GITLAB_CREDENTIAL # optional, whether to log when setting remote url with sensitive `token` displayed ``` diff --git a/src/comment.ts b/src/comment.ts index dba3a812..be977417 100644 --- a/src/comment.ts +++ b/src/comment.ts @@ -76,9 +76,12 @@ Merging this MR will not cause a version bump for any packages. If these changes ${getReleasePlanMessage(releasePlan)} -[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md). +${ + env.GITLAB_COMMENT_CUSTOM_LINKS || + `[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md). -[Click here if you're a maintainer who wants to add a changeset to this MR](${addChangesetUrl}) +[Click here if you're a maintainer who wants to add a changeset to this MR](${addChangesetUrl})` +} __${generatedByBotNote}__ ` @@ -95,9 +98,12 @@ Latest commit: ${commitSha} ${getReleasePlanMessage(releasePlan)} -Not sure what this means? [Click here to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md). +${ + env.GITLAB_COMMENT_CUSTOM_LINKS || + `Not sure what this means? [Click here to learn what changesets are](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md). -[Click here if you're a maintainer who wants to add another changeset to this MR](${addChangesetUrl}) +[Click here if you're a maintainer who wants to add another changeset to this MR](${addChangesetUrl})` +} __${generatedByBotNote}__ ` diff --git a/src/types.ts b/src/types.ts index 4edbf94f..80fd1088 100644 --- a/src/types.ts +++ b/src/types.ts @@ -23,6 +23,7 @@ export type Env = GitLabCIPredefinedVariables & GITLAB_COMMENT_DISCUSSION_AUTO_RESOLVE?: LooseString<'1' | 'true'> GITLAB_ADD_CHANGESET_MESSAGE?: string DEBUG_GITLAB_CREDENTIAL?: LooseString<'1' | 'true'> + GITLAB_COMMENT_CUSTOM_LINKS?: string HOME: string NPM_TOKEN?: string From e7ea1d5cd96e643e9db81d136f990296d4775723 Mon Sep 17 00:00:00 2001 From: JounQin Date: Tue, 1 Apr 2025 17:32:39 +0800 Subject: [PATCH 2/2] docs: add changeset for releasing --- .changeset/short-queens-cover.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/short-queens-cover.md diff --git a/.changeset/short-queens-cover.md b/.changeset/short-queens-cover.md new file mode 100644 index 00000000..eeab1c68 --- /dev/null +++ b/.changeset/short-queens-cover.md @@ -0,0 +1,5 @@ +--- +"changesets-gitlab": minor +--- + +feat: add a new optional `GITLAB_COMMENT_CUSTOM_LINKS` environment variable to override the links content referenced in the cli bot comment