-
Notifications
You must be signed in to change notification settings - Fork 27
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
"Unauthorized" error with TokenSource from environment or git config #5
Comments
Hi @keyvan , I could publish using sbt-github-packages. I provided token via environment variable. Optional - if you want to use github actions, I hope this helps. |
Thanks @Poorva17. Yes, I've followed all those points already and am able to echo back the value successfully. The token has the right permissions also (I can use the same token through hard-coding it in my SBT build for local testing successfully). I haven't tried this on Github actions yet. Trying to get this to work locally first. |
Some additional info here that would help: I simply replaced the following line:
with
So that I read the environment variable directly and this just works. This was just an experiment and I did NOT change anything else. |
This is very interesting because I actually tested the plugin with the environment variable approach. In fact, that's how I have my local setup configured! Regarding the I honestly have no explanation for what you're seeing with the environment variables. :-( |
Thanks for the input. Yeah, it's weird but I think I can work around it using gitHub.token approach. Btw, thanks for the library. Very valuable. |
I tested my setup locally by dumping my credentials into the SBT file and could publish successfully, however, when I moved the exact same token to my profile or my git configs and referenced them from SBT, I get an Unauthorized error.
From the line:
It looks like it can't grab the token from somewhere but it does seem to be there.
I configured in two ways:
and also
And it fails in both cases. I did make sure that the correct token is stored in ~/.gitconfig correctly as:
And I also stored the token in ~/.zprofile and ~/.profile both (I use zsh) and could echo the correct value successfully:
Any thoughts on what may be wrong? I have a feeling I may be missing something but going through your documentation and source code, I couldn't find a smoking gun.
The text was updated successfully, but these errors were encountered: