-
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
Regression since 0.4.0: unable to use TokenSource.Environment("GITHUB_TOKEN") as an optional token source #20
Comments
Moreover, after upgrading to 0.5.0 my workflow is failing with the same error:
see https://github.com/gamatron/threescala/runs/604502887?check_suite_focus=true |
Is this a typo? It needs to be in the Does that print out your token? It's very possible there is a regression here. I'll take a look and see if I can identify anything. |
This is the current interpreter for def resolveTokenSource(tokenSource: TokenSource): Option[String] = {
tokenSource match {
case TokenSource.Or(primary, secondary) =>
resolveTokenSource(primary).orElse(
resolveTokenSource(secondary))
case TokenSource.Environment(variable) =>
sys.env.get(variable)
case TokenSource.GitConfig(key) =>
Try(s"git config $key".!!).map(_.trim).toOption
}
} Nothing in there looks suspicious to me, though it is utterly untestable. I'm curious as to the results of running |
I confirm |
Perhaps the error is given from some other place? How about following lines, which seem to reference GITHUB_TOKEN explicitly and unconditionaly: sbt-github-packages/src/main/scala/sbtghpackages/GitHubPackagesPlugin.scala Lines 44 to 47 in 56f622b
? |
Ah! I see what's going on. So the issue is that I changed the scoping of the settings to more closely match what other publication plugins do. Remove |
I find it a bit strange, I thought |
It doesn't works for me. How one can possibly define it's own
Steps to reproduce:
|
That line is sequenced first, before your build definition, meaning that your build overrides it. Can you show me a simple build.sbt which reproduces the issue? This plugin, as with most, assumes that you are running But with all that said, I wonder if I can loosen this definition scoping to make it a bit more ergonomic… |
Trying to reproduce issue with a simple sbt project proves that removing
My current project is more complicated (a lot of submodules, shared settings, etc.) Sorry for reactivating this issue. I think it could be closed. Thank you for the kind reply. |
Related to #16
I have this in my project:
When I open sbt and peform
update
, I get following error:(credentials) unable to locate a valid GitHub token from Environment(GITHUB_TOKEN)
I have the token present in the .githubconfig file, therefore I do not understand why it is trying to load it from
GITHUB_TOKEN
. The configuration has worked fine with 0.3.1 and 0.3.2, but not with 0.4.0It is possible to define a dummy
GITHUB_TOKEN
environment variable as as a workaround.The text was updated successfully, but these errors were encountered: