giget
giget copied to clipboard
Try using `gh` cli token as fallback when cloning github sources
trafficstars
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
- [X] Would you be willing to help implement this feature?
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 👍🏼