sbt-github-packages icon indicating copy to clipboard operation
sbt-github-packages copied to clipboard

Credentials should remain optional

Open huntc opened this issue 4 years ago • 6 comments

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.

huntc avatar Feb 04 '21 01:02 huntc

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

l15k4 avatar Feb 26 '21 07:02 l15k4

@djspiewak could this be merged? It's rather annoying to work around this issue when one is not currently requiring a GITHUB_TOKEN.

nightscape avatar Feb 26 '21 16:02 nightscape

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.

l15k4 avatar Mar 01 '21 07:03 l15k4

Sorry I've been super-swamped! Catching up on all of this.

djspiewak avatar Mar 07 '21 20:03 djspiewak

What happened to this? Without it, bloopInstall seems to always fail unless you add the token to your global env.

hejfelix avatar Oct 12 '21 11:10 hejfelix

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.

mhammons-ledger avatar Feb 16 '22 14:02 mhammons-ledger