0

I'm trying to setup some kind of versioning pipeline on Github actions. I'm working with a Monorepo with many other project who have their own independent versioning, so I find myself unable to use the releases functionality or pushing my version changes as a commit.

Previously, I worked with Azure pipelines, which have a very useful counter function whose state is maintained by Azure. It doesn't require committing changes or creating releases, which means I could simply set the version for that specific pipeline with:

npm version <value from azure>

And the value would automatically change on the next Azure run. On top of that, if either major or minor values were changed, it would reset the patch value to 0 and start the counter again.

Can I do anything similar on Github? I know I can use ${{ github.run_number }} to get the workflow's number, so I can run:

npm version 1.0.${{ github.run_number }}

But I'd like my patch version to start back from zero if either major or minor are changed.

lpetrucci
  • 1,285
  • 4
  • 22
  • 40
  • There's no good answer for this in GitHub Actions at the moment. You'll need to store the version somewhere, be it a tag, release, package, azure blob storage or anything else. A very similar question: https://stackoverflow.com/a/75901913/736079 – jessehouwing Apr 26 '23 at 10:39
  • We support this via Reliza Hub (3rd party) via get version action - https://github.com/relizaio/reliza-get-version - just create project in Reliza Hub as shown here - https://docs.relizahub.com/get-started/#register-and-log-in and point get version action to it - should give you unique version on each run. Also you can control versioning patch, major, minor if you follow Conventional Commits specification. – taleodor Apr 27 '23 at 02:15

0 Answers0