-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
ci-status without local repo #2344
Comments
You are correct in your observations—hub was primarily designed to be run from the context of a git repo. This requirement makes less sense for commands such as In the meantime, you can work around this by initializing an empty repository, no need to clone anything: git init
git remote add origin "https://github.com/OWNER/REPO"
hub ci-status ... It might look a bit clumsy but it's cheap (resource-wise) and will work well. |
It is a private repo. So I would have to setup a whole ssh setup inside the Container. Which seems like pure overkill. For now I work around this with:
|
Hub does all its API operations over HTTPS, not SSH. As my workaround above doesn't involve any cloning or git transfer whatsoever (look at it closely; adding the git remote is only so that hub can pick up the correct GitHub repository), you don't need to set up SSH. You only need to provide hub with a GITHUB_TOKEN that has access to your private repo. |
If you look at my example, I want to get the status of master. In your empty local clone, it cannot lookup master and thus complains: |
Ah sorry, you're right. Your |
Currently I am trying to retrieve
ci-status
from a repo.Looking at the code, it seems like it enforces a local repo clone!? Could someone please explain why that is?
AFAIK the ci-status is not directly linked to the git graph and thus should work fine without a local clone (which takes time).
The problem is made worse by the fact that cloning is non-trivial in a containerized environment (Kubernetes).
I was hoping that
hub clone
would do the trick in combination withGITHUB_TOKEN
but it seems like I missed the point ofhub clone
.The text was updated successfully, but these errors were encountered: