Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

auth/login: fix broken link to personal_access_token #785

Merged
merged 1 commit into from
Jul 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ If a supported binary for your OS is not found at the [releases page](https://gi

## Authentication

Get a GitLab access token at <https://gitlab.com/profile/personal_access_tokens> or <https://gitlab.example.com/profile/personal_access_tokens> if self-hosted
Get a GitLab access token at <https://gitlab.com/-/profile/personal_access_tokens> or <https://gitlab.example.com/-/profile/personal_access_tokens> if self-hosted

- start interactive setup
```sh
Expand Down
2 changes: 1 addition & 1 deletion commands/auth/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,6 @@ func getAccessTokenTip(hostname string) string {
glHostname = glinstance.OverridableDefault()
}
return fmt.Sprintf(`
Tip: you can generate a Personal Access Token here https://%s/profile/personal_access_tokens
Tip: you can generate a Personal Access Token here https://%s/-/profile/personal_access_tokens
The minimum required scopes are 'api' and 'write_repository'.`, glHostname)
}
2 changes: 1 addition & 1 deletion internal/config/config_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func NewBlankRoot() *yaml.Node {
Value: "gitlab.com",
},
{
HeadComment: "Your GitLab access token. Get an access token at https://gitlab.com/profile/personal_access_tokens",
HeadComment: "Your GitLab access token. Get an access token at https://gitlab.com/-/profile/personal_access_tokens",
Kind: yaml.ScalarNode,
Value: "token",
},
Expand Down
4 changes: 2 additions & 2 deletions internal/config/config_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func Test_fileConfig_Set(t *testing.T) {
//assert.NoError(t, a.Set("co", "mr checkout"))
//assert.NoError(t, a.Write())

expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: ssh\n# What editor glab should run when creating issues, merge requests, etc. This is a global config that cannot be overridden by hostname.\neditor: nano\n# What browser glab should run when opening links. This is a global config that cannot be overridden by hostname.\nbrowser:\n# Set your desired markdown renderer style. Available options are [dark, light, notty] or set a custom style. Refer to https://github.com/charmbracelet/glamour#styles\nglamour_style: dark\n# Allow glab to automatically check for updates and notify you when there are new updates\ncheck_update: false\n# configuration specific for gitlab instances\nhosts:\n gitlab.com:\n # What protocol to use to access the api endpoint. Supported values: http, https\n api_protocol: https\n # Configure host for api endpoint, defaults to the host itself\n api_host: gitlab.com\n # Your GitLab access token. Get an access token at https://gitlab.com/profile/personal_access_tokens\n token:\n git_protocol: ssh\n username: hubot\n example.com:\n editor: vim\n"
expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: ssh\n# What editor glab should run when creating issues, merge requests, etc. This is a global config that cannot be overridden by hostname.\neditor: nano\n# What browser glab should run when opening links. This is a global config that cannot be overridden by hostname.\nbrowser:\n# Set your desired markdown renderer style. Available options are [dark, light, notty] or set a custom style. Refer to https://github.com/charmbracelet/glamour#styles\nglamour_style: dark\n# Allow glab to automatically check for updates and notify you when there are new updates\ncheck_update: false\n# configuration specific for gitlab instances\nhosts:\n gitlab.com:\n # What protocol to use to access the api endpoint. Supported values: http, https\n api_protocol: https\n # Configure host for api endpoint, defaults to the host itself\n api_host: gitlab.com\n # Your GitLab access token. Get an access token at https://gitlab.com/-/profile/personal_access_tokens\n token:\n git_protocol: ssh\n username: hubot\n example.com:\n editor: vim\n"
assert.Equal(t, expected, mainBuf.String())
assert.Equal(t, `ci: pipeline ci
co: mr checkout
Expand All @@ -37,7 +37,7 @@ func Test_defaultConfig(t *testing.T) {
cfg := NewBlankConfig()
assert.NoError(t, cfg.Write())

expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: ssh\n# What editor glab should run when creating issues, merge requests, etc. This is a global config that cannot be overridden by hostname.\neditor:\n# What browser glab should run when opening links. This is a global config that cannot be overridden by hostname.\nbrowser:\n# Set your desired markdown renderer style. Available options are [dark, light, notty] or set a custom style. Refer to https://github.com/charmbracelet/glamour#styles\nglamour_style: dark\n# Allow glab to automatically check for updates and notify you when there are new updates\ncheck_update: false\n# configuration specific for gitlab instances\nhosts:\n gitlab.com:\n # What protocol to use to access the api endpoint. Supported values: http, https\n api_protocol: https\n # Configure host for api endpoint, defaults to the host itself\n api_host: gitlab.com\n # Your GitLab access token. Get an access token at https://gitlab.com/profile/personal_access_tokens\n token:\n"
expected := "# What protocol to use when performing git operations. Supported values: ssh, https\ngit_protocol: ssh\n# What editor glab should run when creating issues, merge requests, etc. This is a global config that cannot be overridden by hostname.\neditor:\n# What browser glab should run when opening links. This is a global config that cannot be overridden by hostname.\nbrowser:\n# Set your desired markdown renderer style. Available options are [dark, light, notty] or set a custom style. Refer to https://github.com/charmbracelet/glamour#styles\nglamour_style: dark\n# Allow glab to automatically check for updates and notify you when there are new updates\ncheck_update: false\n# configuration specific for gitlab instances\nhosts:\n gitlab.com:\n # What protocol to use to access the api endpoint. Supported values: http, https\n api_protocol: https\n # Configure host for api endpoint, defaults to the host itself\n api_host: gitlab.com\n # Your GitLab access token. Get an access token at https://gitlab.com/-/profile/personal_access_tokens\n token:\n"
assert.Equal(t, expected, mainBuf.String())
assert.Equal(t, "", hostsBuf.String())

Expand Down