Skip to content

feat(electron-publish): add support for a read/write token to publish to a private gitlab repository#9680

Draft
andreamarelli wants to merge 1 commit into
electron-userland:masterfrom
andreamarelli:add-gitlab-publisher-private-repo-token
Draft

feat(electron-publish): add support for a read/write token to publish to a private gitlab repository#9680
andreamarelli wants to merge 1 commit into
electron-userland:masterfrom
andreamarelli:add-gitlab-publisher-private-repo-token

Conversation

@andreamarelli
Copy link
Copy Markdown

Using the same approach followed by GitHubPublisher, this PR add support for GITLAB_RELEASE_TOKEN token to be used during publishing to a private repository, where the token requires write permissions.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 14, 2026

⚠️ No Changeset found

Latest commit: ebc7afb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@andreamarelli andreamarelli changed the title Add support for a read/write token to publish to a private gitlab repository feat(electron-publish): add support for a read/write token to publish to a private gitlab repository Apr 14, 2026
token = process.env.GITLAB_TOKEN || null
let token = info.token
if (isEmptyOrSpaces(token) || process.env.GITLAB_RELEASE_TOKEN) {
token = process.env.GITLAB_RELEASE_TOKEN ? process.env.GITLAB_RELEASE_TOKEN : process.env.GITLAB_TOKEN || null
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please update the GitlabOptions description about this new env var?

* Define `GITLAB_TOKEN` environment variable.
*/
export interface GitlabOptions extends PublishConfiguration {

Also, is this intended to always override the GITLAB_TOKEN env var even if the RELEASE_TOKEN is present? This logic seems odd to me but at least should be described in the docs.

After updating the publishOptions.ts tsdocs, please run pnpm generate-all for the schema and site docs.

if (isEmptyOrSpaces(token) || process.env.GITLAB_RELEASE_TOKEN) {
token = process.env.GITLAB_RELEASE_TOKEN ? process.env.GITLAB_RELEASE_TOKEN : process.env.GITLAB_TOKEN || null
if (isEmptyOrSpaces(token)) {
throw new InvalidConfigurationError(`GitLab Personal Access Token is not set, neither programmatically, nor using env "GITLAB_TOKEN"`)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message should be updated to mention the GITLAB_RELEASE_TOKEN as well.

Copy link
Copy Markdown
Collaborator

@mmaietta mmaietta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also generate a changeset file via pnpm generate-changeset so this is properly picked up by the CI/CD pipeline

@mmaietta mmaietta marked this pull request as draft May 3, 2026 15:25
@mmaietta mmaietta marked this pull request as draft May 3, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants