sbt / sbt-ci-release

sbt plugin to automate Sonatype releases from GitHub Actions
Apache License 2.0
286 stars 76 forks source link

Triggering non-snapshot release via workflow_run on GitHub Actions #305

Open michaelmior opened 3 months ago

michaelmior commented 3 months ago

I'm trying to use sbt-ci-release GitHub Actions. However, instead of the workflow being triggered directly on push, I have it triggered on workflow_run so it only fires after my test suite has successfully completed. This mostly works, but the problem is that GITHUB_REF is not preserved but is instead set to the default branch. It seems like sbt-ci-release thinks it should be snapshot release but then it will (correctly) detect that the version does not contain SNAPSHOT and abort.

Since it's not possible to override GITHUB_REF, it seems I could use something like TRAVIS_TAG as it comes before the GITHUB_REF checks, but this is obviously a bit of a hack. It would be nice if there was a way to explicitly pass the branch and tag to sbt-ci-release.