You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,12 +154,23 @@ Note: ghorg will respect the `XDG_CONFIG_HOME` [environment variable](https://wi
154
154
155
155
> Note: ghorg supports both Bitbucket Cloud and Bitbucket Server (self-hosted instances)
156
156
157
-
#### App Passwords
157
+
#### API Tokens (Recommended for Bitbucket Cloud)
158
158
159
-
1. To configure with bitbucket you will need to create a new [app password](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html) and update your `$HOME/.config/ghorg/conf.yaml` or use the (--token, -t) and (--bitbucket-username) flags.
160
-
1. Update [SCM type](https://github.com/gabrie30/ghorg/blob/master/sample-conf.yaml#L54-L57) to `bitbucket` in your `ghorg/conf.yaml` or via cli flags
159
+
Bitbucket has deprecated App Passwords in favor of API Tokens. This is the recommended authentication method for Bitbucket Cloud.
160
+
161
+
1. Create an [API token](https://support.atlassian.com/bitbucket-cloud/docs/create-an-api-token/) from your Atlassian account settings
162
+
1.**Important**: When creating the token, grant **all read scopes** (Account: Read, Workspace membership: Read, Projects: Read, Repositories: Read, etc.) to ensure ghorg can list and clone repositories
163
+
1. Set `GHORG_BITBUCKET_API_TOKEN` in your `$HOME/.config/ghorg/conf.yaml` or use the `--token` flag
164
+
1. Set `GHORG_BITBUCKET_API_EMAIL` to your Atlassian account email (or use `--bitbucket-api-email`)
165
+
1. Update SCM type to `bitbucket` in your `ghorg/conf.yaml` or via cli flags
161
166
1. See [examples/bitbucket.md](https://github.com/gabrie30/ghorg/blob/master/examples/bitbucket.md) on how to run
162
167
168
+
> Note: When using API tokens, ghorg automatically uses `x-bitbucket-api-token-auth` as the Git username for clone operations, as required by Bitbucket's API token authentication.
169
+
170
+
#### App Passwords (Legacy)
171
+
172
+
> Note: Bitbucket has deprecated App Passwords. Consider using API Tokens instead.
173
+
163
174
#### PAT/OAuth token
164
175
165
176
1. Create a [PAT](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html)
Copy file name to clipboardExpand all lines: cmd/examples-copy/bitbucket.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,45 @@ To view all additional flags see the [sample-conf.yaml](https://github.com/gabri
8
8
9
9
## Bitbucket Cloud
10
10
11
+
### API Token Authentication (Recommended)
12
+
13
+
Bitbucket has deprecated App Passwords in favor of API Tokens. This is the recommended authentication method.
14
+
15
+
**Creating the API Token:**
16
+
1. Go to your [Atlassian account settings](https://id.atlassian.com/manage/api-tokens)
17
+
2. Create a new API token
18
+
3.**Important**: Grant **all read scopes** (Account: Read, Workspace membership: Read, Projects: Read, Repositories: Read) to ensure ghorg can list and clone repositories
19
+
20
+
**Using the API Token:**
21
+
22
+
1. Clone the microsoft workspace using an API token
23
+
24
+
```
25
+
ghorg clone microsoft --scm=bitbucket --bitbucket-api-email=<your-atlassian-email> --token=<api-token>
26
+
```
27
+
28
+
1. Using environment variables (recommended for scripts)
> Note: When using API tokens, ghorg automatically uses `x-bitbucket-api-token-auth` as the Git username for clone operations. The email is only used for API calls to list repositories.
37
+
38
+
### App Password Authentication (Legacy)
39
+
40
+
> Note: Bitbucket has deprecated App Passwords. Consider using API Tokens instead.
41
+
11
42
1. Clone the microsoft workspace using an app-password
12
43
13
44
```
14
45
ghorg clone microsoft --scm=bitbucket --bitbucket-username=<your-username> --token=<app-password>
15
46
```
16
47
48
+
### OAuth Token Authentication
49
+
17
50
1. Clone the microsoft workspace using oauth token
cloneCmd.Flags().StringVar(&protocol, "protocol", "", "GHORG_CLONE_PROTOCOL - Protocol to clone with, ssh or https, (default https)")
375
378
cloneCmd.Flags().StringVarP(&path, "path", "p", "", "GHORG_ABSOLUTE_PATH_TO_CLONE_TO - Absolute path to the home for ghorg clones. Must start with / (default $HOME/ghorg)")
376
379
cloneCmd.Flags().StringVarP(&branch, "branch", "b", "", "GHORG_BRANCH - Branch left checked out for each repo cloned (default master)")
Copy file name to clipboardExpand all lines: configs/configs.go
+40-7Lines changed: 40 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,12 @@ var (
38
38
// ErrNoBitbucketAppPassword error message when no app password found
39
39
ErrNoBitbucketAppPassword=errors.New("Could not find a valid bitbucket app password. GHORG_BITBUCKET_APP_PASSWORD or (--token, -t) must be set to clone repos from bitbucket, see 'BitBucket Setup' in README.md")
40
40
41
+
// ErrNoBitbucketAPIToken error message when no API token found
42
+
ErrNoBitbucketAPIToken=errors.New("Could not find a valid bitbucket API token. GHORG_BITBUCKET_API_TOKEN or (--token, -t) must be set to clone repos from bitbucket, see 'BitBucket Setup' in README.md")
43
+
44
+
// ErrNoBitbucketAPIEmail error message when no email found for API token auth
45
+
ErrNoBitbucketAPIEmail=errors.New("When using GHORG_BITBUCKET_API_TOKEN, you must also set GHORG_BITBUCKET_API_EMAIL or GHORG_BITBUCKET_USERNAME (your Atlassian account email), see 'BitBucket Setup' in README.md")
46
+
41
47
// ErrIncorrectScmType indicates an unsupported scm type being used
42
48
ErrIncorrectScmType=errors.New("GHORG_SCM_TYPE or --scm must be one of "+strings.Join(scm.SupportedClients(), ", "))
Copy file name to clipboardExpand all lines: examples/bitbucket.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,45 @@ To view all additional flags see the [sample-conf.yaml](https://github.com/gabri
8
8
9
9
## Bitbucket Cloud
10
10
11
+
### API Token Authentication (Recommended)
12
+
13
+
Bitbucket has deprecated App Passwords in favor of API Tokens. This is the recommended authentication method.
14
+
15
+
**Creating the API Token:**
16
+
1. Go to your [Atlassian account settings](https://id.atlassian.com/manage/api-tokens)
17
+
2. Create a new API token
18
+
3.**Important**: Grant **all read scopes** (Account: Read, Workspace membership: Read, Projects: Read, Repositories: Read) to ensure ghorg can list and clone repositories
19
+
20
+
**Using the API Token:**
21
+
22
+
1. Clone the microsoft workspace using an API token
23
+
24
+
```
25
+
ghorg clone microsoft --scm=bitbucket --bitbucket-api-email=<your-atlassian-email> --token=<api-token>
26
+
```
27
+
28
+
1. Using environment variables (recommended for scripts)
> Note: When using API tokens, ghorg automatically uses `x-bitbucket-api-token-auth` as the Git username for clone operations. The email is only used for API calls to list repositories.
37
+
38
+
### App Password Authentication (Legacy)
39
+
40
+
> Note: Bitbucket has deprecated App Passwords. Consider using API Tokens instead.
41
+
11
42
1. Clone the microsoft workspace using an app-password
12
43
13
44
```
14
45
ghorg clone microsoft --scm=bitbucket --bitbucket-username=<your-username> --token=<app-password>
15
46
```
16
47
48
+
### OAuth Token Authentication
49
+
17
50
1. Clone the microsoft workspace using oauth token
0 commit comments