gabrie30 / ghorg

Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more 🐇🥚
Apache License 2.0
1.58k stars 167 forks source link

Allow github app token created outside of ghorg to be used for https via `GHORG_GITHUB_TOKEN_FROM_GITHUB_APP` setting #460

Closed PaarthShah closed 1 month ago

PaarthShah commented 1 month ago

Status

READY

Description

In the context of a larger pipeline, I'm running ghorg and already have an app token. However, cloning repos via https requires the x-access-token username component to be set, and this currently only happens if ghorg itself obtained the app token.

I'm honestly not sure whether this is a well-named variable, but GHORG_GITHUB_TOKEN_IS_AN_APP_TOKEN seemed a little verbose and out of place, so feedback definitely desired and appreciated!

gabrie30 commented 1 month ago

Thanks for raising this! Can we use these as the naming convention? Other than that looks good to me

GHORG_GITHUB_TOKEN_FROM_GITHUB_APP 
--github-token-from-github-app
PaarthShah commented 1 month ago

@gabrie30 Name sounded obvious when you suggested it, ty! Changed!

gabrie30 commented 1 month ago

Looks great thanks again for your contribution @PaarthShah I had no idea about this.

Also, do you need a new release cut?

PaarthShah commented 1 month ago

@gabrie30 Tldr: interested in new release, but no rush!

No worries at all! This project solved a very specific need for us so I was glad to find it, and glad to be able to contribute back and keep my golang sharp!

And would definitely like a new official release (especially the docker image as that's what I ended up using directly), BUT it is not pressing/urgent as I already managed an (ugly, but not unsafe) workaround within the pipeline in question; but I'll happily revert it whenever a new release is out!

gabrie30 commented 1 month ago

I'll shoot for this weekend or early next week then for the next release.

gabrie30 commented 1 month ago

New release has been cut @PaarthShah