Skip to content
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

Merged
merged 3 commits into from
Oct 1, 2021

Conversation

sr258
Copy link
Contributor

@sr258 sr258 commented Sep 27, 2021

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

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2021

🦋 Changeset detected

Latest commit: 72bc6fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

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

@netlify
Copy link

netlify bot commented Sep 27, 2021

✔️ 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)
Copy link
Collaborator

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)

@sr258
Copy link
Contributor Author

sr258 commented Sep 29, 2021

@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?

@mmaietta
Copy link
Collaborator

Oomph. Great detection! Please open as new PR so that we can keep each all explicit.

@sr258
Copy link
Contributor Author

sr258 commented Sep 30, 2021

@mmaietta Alright, this PR should be ready then.

@mmaietta mmaietta merged commit 8ebfc96 into electron-userland:master Oct 1, 2021
@github-actions github-actions bot mentioned this pull request Oct 1, 2021
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.

BitBucket Publish doesn't work if user and owner are different
2 participants