-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(publish): Bitbucket publish can have username different from owner #6293
fix(publish): Bitbucket publish can have username different from owner #6293
Conversation
🦋 Changeset detectedLatest commit: 72bc6fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✔️ Deploy Preview for jolly-roentgen-9c9aba ready! 🔨 Explore the source changes: 72bc6fc 🔍 Inspect the deploy log: https://app.netlify.com/sites/jolly-roentgen-9c9aba/deploys/615405b2c2927800072257ee 😎 Browse the preview: https://deploy-preview-6293--jolly-roentgen-9c9aba.netlify.app |
if (isEmptyOrSpaces(token)) { | ||
throw new InvalidConfigurationError(`Bitbucket token is not set using env "BITBUCKET_TOKEN" (see https://www.electron.build/configuration/publish#BitbucketOptions)`) | ||
} | ||
this.info = info | ||
this.auth = BitbucketPublisher.convertAppPassword(this.info.owner, token) | ||
this.auth = BitbucketPublisher.convertAppPassword(this.info.owner, token, username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend keeping the same function signature since it's already explicit and instead do:
this.auth = BitbucketPublisher.convertAppPassword(username ?? this.info.owner, token)
@mmaietta Thank you for your feedback. I've changed the requested things. While working with the BitBucket publisher I've noticed that auto-updates don't work if the productName contains whitespaces as BitBucket converts whitespaces into underscores (_) when you upload files. The latest.yml file references the files with whitespaces, so the download doesn't work. I'd like to submit a PR to fix this. Should I include this in this PR (one big BitBucket PR) or create a separate one? |
Oomph. Great detection! Please open as new PR so that we can keep each all explicit. |
@mmaietta Alright, this PR should be ready then. |
The way BitbucketPublisher is written, you can't use it to publish to repositories if you are not the owner of them. The PR introduces a new environment variable that allows you to change the override the username if necessary.
Closes #6292