Skip to content

Commit 4ca179c

Browse files
feat: add a new optional GITLAB_COMMENT_CUSTOM_LINKS env (#209)
Co-authored-by: Filipe Ferreira <fiferreira@roku.com>
1 parent e7cbdff commit 4ca179c

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.changeset/short-queens-cover.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"changesets-gitlab": minor
3+
---
4+
5+
feat: add a new optional `GITLAB_COMMENT_CUSTOM_LINKS` environment variable to override the links content referenced in the cli bot comment

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ GITLAB_CI_USER_NAME # optional, username with accessibility t
5454
GITLAB_CI_USER_EMAIL # optional, default `gitlab[bot]@users.noreply.gitlab.com`
5555
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
5656
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`
57+
GITLAB_COMMENT_CUSTOM_LINKS # optional, override the links content referenced in the cli bot comment
5758
GITLAB_ADD_CHANGESET_MESSAGE # optional, default commit message for adding changesets on GitLab Web UI
5859
DEBUG_GITLAB_CREDENTIAL # optional, whether to log when setting remote url with sensitive `token` displayed
5960
```

src/comment.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ Merging this MR will not cause a version bump for any packages. If these changes
7676
7777
${getReleasePlanMessage(releasePlan)}
7878
79-
[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).
79+
${
80+
env.GITLAB_COMMENT_CUSTOM_LINKS ||
81+
`[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
8082
81-
[Click here if you're a maintainer who wants to add a changeset to this MR](${addChangesetUrl})
83+
[Click here if you're a maintainer who wants to add a changeset to this MR](${addChangesetUrl})`
84+
}
8285
8386
__${generatedByBotNote}__
8487
`
@@ -95,9 +98,12 @@ Latest commit: ${commitSha}
9598
9699
${getReleasePlanMessage(releasePlan)}
97100
98-
Not sure what this means? [Click here to learn what changesets are](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).
101+
${
102+
env.GITLAB_COMMENT_CUSTOM_LINKS ||
103+
`Not sure what this means? [Click here to learn what changesets are](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
99104
100-
[Click here if you're a maintainer who wants to add another changeset to this MR](${addChangesetUrl})
105+
[Click here if you're a maintainer who wants to add another changeset to this MR](${addChangesetUrl})`
106+
}
101107
102108
__${generatedByBotNote}__
103109
`

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type Env = GitLabCIPredefinedVariables &
2323
GITLAB_COMMENT_DISCUSSION_AUTO_RESOLVE?: LooseString<'1' | 'true'>
2424
GITLAB_ADD_CHANGESET_MESSAGE?: string
2525
DEBUG_GITLAB_CREDENTIAL?: LooseString<'1' | 'true'>
26+
GITLAB_COMMENT_CUSTOM_LINKS?: string
2627

2728
HOME: string
2829
NPM_TOKEN?: string

0 commit comments

Comments
 (0)