octoherd / cli

CLI to run a octoherd scripts on one or multiple repositories
ISC License
103 stars 9 forks source link

enable using token from ~/.netrc #14

Open travi opened 3 years ago

travi commented 3 years ago

i'll try to get a PR together sometime soon to make this possible with octokit-auth-netrc

gr2m commented 3 years ago

Let's talk about authentication in general. I was thinking to introduce a prompt to ask about authentication if the --octoherd-token CLI argument is not passed.

In that prompt, we can utilize octokit-auth-netrc to check if it finds a token and suggests that as an option.

The other options I'd like to start with:

  1. Enter a token
  2. Create a new token using @octokit/auth-oauth-device

Future ideas:

  1. Add option to authenticate using a GitHub app, either by entering App ID and Private Key or by using the GitHub App Manifest Flow to create a GitHub App. If we support GitHub App authentication we need to update the way we iterate through repositories
  2. Question: should we keep a session / multiple sessions, similar to other CLIs such as npm or gh. We could introduce octoherd login and run scripts using octoherd run. I haven't done this before though, so I wonder what the conventions and security considerations are here. I'd also like to keep Deno compatibility in mind, see #5
koalaty-code commented 1 year ago

With the recent introduction of support for GHES domains, octokit-auth-netrc will need to be updated to also support custom domains. I have opened a PR to support GHES domain in the netrc plugin: https://github.com/travi/octokit-auth-netrc/pull/608