electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.46k stars 1.71k forks source link

Enable Bitbucket Access Token Authentication for Electron Builder #8204

Open cek61 opened 2 months ago

cek61 commented 2 months ago

Issue: When using Bitbucket as provider for publishing it is only possible to authenticate via username and token. I would like to use a repository access token for authentication. It looks like it is not possible because the BitbucketPublisher always creates a Basic Authentication header.

Current configuration needs to be like this:

publish:
    provider: bitbucket
    owner: <owner> 
    slug: <slug>
    username: <bitbucket-username> # optional, if username != owner
    token: <bitbucket-app-password>

Why do I need this: My Bitbucket repository is a private repository with multiple contributors. The pipeline needs to build and publish my app. I don't want to use my personal username and app password neither I want to create a technical user.

Solution: Bitbucket provides the option to use access tokens. We would need to figure out how to pass an access token to the publish config. It should be treated as Bearer Token and not as Basic Authentication.

Approach: Introduce a new config value named "accessToken" for new authentication method. If it is provided then always try to use it as Bearer Token.

I would like to configure the provider like this:

publish:
    provider: bitbucket
    owner: <owner> 
    slug: <slug>
    accessToken: <bitbucket-access-token>

The access token then needs to be in the request header as Bearer token. Using this method I don't need to pass a username.

github-actions[bot] commented 19 hours ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.