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

Try using gh cli token as fallback when cloning github sources #142

Open
1 task done
cpreston321 opened this issue Jan 11, 2024 · 1 comment
Open
1 task done

Try using gh cli token as fallback when cloning github sources #142

cpreston321 opened this issue Jan 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@cpreston321
Copy link
Member

cpreston321 commented Jan 11, 2024

Describe the feature

Github already provides this locally if you auth with gh in this case it can cover most private repo cases without creating a new token . This can used by trying to run it with execa fallbacks to undefined

E.g

options.auth = options.auth || (await execa('gh', ['auth', 'token']).then(r => r.stdout).catch(() => undefined))

Maybe it can be a CLI param like --use-gh-auth that enables this function to that might be more viable.

Additional information

  • Would you be willing to help implement this feature?
@pi0
Copy link
Member

pi0 commented Mar 6, 2024

Hi thanks for this tip. We can also read the file directly from known path: https://github.com/unjs/changelogen/blob/main/src/github.ts#L120

Feel free to make a PR for this 👍🏼

@pi0 pi0 added the enhancement New feature or request label Mar 6, 2024
@pi0 pi0 changed the title Fallback to using gh auth token when using github provider Try using gh cli token as fallback when cloning github sources Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants