Closed garethr closed 4 years ago
Sure, that sounds fine to me.
The auth.json
mechanism this uses is standard across all of the other Dogsheep tools - it's actually designed so you can have one auth.json
with a bunch of different credentials for different tools:
{
"goodreads_personal_token": "...",
"goodreads_user_id": "...",
"github_personal_token": "...",
"pocket_consumer_key": "...",
"pocket_username": "...",
"pocket_access_token": "..."
}
But... github-to-sqlite
does feel like it deserves a special case here, since it's such a good fit for running inside of GitHub Actions - which even provide a GITHUB_TOKEN
for you to use!
So I don't think it will harm the family of tools too much if this has an environment variable alternative to the -a
file.
I also go it working with:
run: echo ${{ secrets.github_token }} | github-to-sqlite auth
Would you accept a PR that falls back to looking for an environment variable for the GitHub token? Specifically a change here: https://github.com/dogsheep/github-to-sqlite/blob/c34d5a18bfc41fa08755ba3d5cf9fe09ff204238/github_to_sqlite/cli.py#L271
I'd like to use
github-to-sqlite
in a GitHub Action workflow and this would be simpler than trying to fill out the prompt or generate a file with sensitive content.Wanted to check first, I'm happy to submit a PR with tests and updates to the docs.