Credentials should remain optional
When publishing with sbt, I believe credentials are only required when the endpoint receiving its artifacts requires them. This PR re-enables this behaviour. As a consequence, the plugin may be used in situations where the user has no credentials given that they are unauthorised to publish artifacts. A valid scenario is that Continuous Delivery is authorised to publish, but no other user.
The plugin also now works in the context of an IDE where the GITHUB_TOKEN environment variable is not found.
Should address https://github.com/djspiewak/sbt-github-packages/issues/30, https://github.com/djspiewak/sbt-github-packages/issues/28, https://github.com/djspiewak/sbt-github-packages/issues/26, https://github.com/djspiewak/sbt-github-packages/issues/16 - but please re-check.
Thanks for this PR, especially when the githubTokenSource cannot be defined in multi-module project as githubTokenSource in ThisBuild or githubTokenSource in Global simply won't help, one has to declared it in each individual project for some reason
@djspiewak could this be merged?
It's rather annoying to work around this issue when one is not currently requiring a GITHUB_TOKEN.
I agree, pretty please @djspiewak 🙏🏼 With bintray being closed soon, a lot of people might start porting to github packages. But this is really essential change.
Sorry I've been super-swamped! Catching up on all of this.
What happened to this? Without it, bloopInstall seems to always fail unless you add the token to your global env.
Seconding the need for this. My coworkers are offput by the need to have a github token provided to SBT to do anything, even compile. Please note that in the case of resolution of dependencies, if the user only publishes to github then it shouldn't be a problem to defer credentials checks till publishing is attempted.