Skip to content

Github authentication for netlify init is not working due to a regression. #3588

@lukasholzer

Description

@lukasholzer

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. remove the global ~/Library/Preferences/netlify/config.json
  2. run netlify init in a new project
  3. Select Authentication via netlify app
  4. Use Github as the authentication method.
  5. It will fail with 401 Bad Credentials

Regression was introduced with this change: https://github.com/netlify/cli/pull/3569/files#diff-f64dd88efec835a92fdd4fd9b786ef5faf32c0c732656935ec33a443efb2c912R39

The problem is that the return type of the getGitHubToken changed from Promise<Record<string, string>> to Promsie<URLSearchParams> which cannot be set inside the globalConfig.

Just to note (TypeScript would have prevented this)

Expected behavior

Authentication via Github should work

CLI Output

Adding deploy key to repository...
 ›   Error: Failed retrieving GitHub repository information with error: Bad credentials.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions