Skip to content

feat: add a new optional GITLAB_COMMENT_CUSTOM_LINKS env #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/short-queens-cover.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
14 changes: 10 additions & 4 deletions src/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}__
`
Expand All @@ -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}__
`
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading