scoverage / sbt-coveralls

sbt-plugin to upload sbt-scoverage reports to coveralls
https://github.com/scoverage
Other
104 stars 50 forks source link

Fix auth token handing in GitHub Actions #274

Closed ruippeixotog closed 1 year ago

ruippeixotog commented 1 year ago

Fixes #257. See discussion in the issue for context.

The solution to support both the old behavior and the buggy one introduced in #212 ended up becoming more difficult than expected. When someone passes only COVERALLS_REPO_TOKEN, it's not possible in general to know if the token passed was a CI service token (old sbt-coveralls behavior for GitHub Actions) or a Coveralls token (forced by the above PR) without asking the user to change some of their settings, which would end up being another breaking change.

In the end, I leveraged the fact that GitHub tokens have identifiable prefixes to support both cases.

Tested this by publishing a snapshot of sbt-coveralls, using it with PureConfig, confirming that GitHub CI jobs were successful and checking Coveralls results.

rolandtritsch commented 1 year ago

@ruippeixotog Thanks for the PR. Some of the (scripted) tests fail. Will try to take a look at it later this week.

ruippeixotog commented 1 year ago

Thanks @rolandtritsch. Like in #266, I think some of the tests in sample projects are flaky and affecting this plugin (there's no reason why sbt-coveralls would cause an assertion on an Akka message to start failing).

rolandtritsch commented 1 year ago

Hi @ruippeixotog. Merged it and made it work/pass. Do you want me to cut a release?

ruippeixotog commented 1 year ago

That would be great, so we can finally upgrade from 1.3.2. Thanks!

rolandtritsch commented 1 year ago

Done. - https://github.com/scoverage/sbt-coveralls/releases/tag/v1.3.10

rolandtritsch commented 1 month ago

This should be fixed now (again) - https://github.com/scoverage/sbt-coveralls/releases/tag/v1.3.13