Skip to content

Gets the version number of a release branch such as release/1.2.3

License

Notifications You must be signed in to change notification settings

valadas/get-release-branch-version

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get-release-branch-version

Gets the version number of a release branch such as release/1.2.3

This action should only be run on release branches. Here is a suggested usage with a check:

name: Get release branch
on: create

jobs:
  get-release:
    name: Get the release branch version number
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - uses: valadas/get-release-branch-version@v1
        id: branchVersion
      - name: Dump the version info
        env:
          MAJOR: ${{ steps.branchVersion.outputs.major }}
          MINOR: ${{ steps.branchVersion.outputs.minor }}
          PATCH: ${{ steps.branchVersion.outputs.patch }}
          MANIFEST_SAFE_VERSION_STRING: ${{ steps.branchVersion.outputs.manifestSafeVersionString }}
        run: "echo major: $MAJOR minor: $MINOR patch: $PATCH manifestSafeVersionString: $MANIFEST_SAFE_VERSION_STRING"

Obviously replace the Dump step with something more useful for your process.

It will output the version number of the release branch:

Ex: Creating a release/1.2.3 branch would output:

output value
major 1
minor 2
patch 3
manifestSafeVersionString 01.02.03

About

Gets the version number of a release branch such as release/1.2.3

Resources

License

Stars

Watchers

Forks

Packages

No packages published