Aautomated versioning of your commits using git tags each time your CI/CD workflow runs.
- Generate a new version based on the last tag present & currently checked out branch.
- Commit message decides which version to bump.
<major>.<minor>.<patch>[-<branch-name>]
Get-Version will always use the latest tag that was pushed to determine next version. Commit message will drive the increment in major or minor version number.
git commit -m "Adding a new file"
1.0.7 -> 1.0.8
A commit message with the substring '#minor' will increment your version's minor revision.
git commit -m "Updating dependencies #minor"
1.0.7 -> 1.1.7
A commit message with the substring '#major' will increment your version's major revision.
git commit -m "Adding breaking changes #major"
1.0.7 -> 2.0.7
If no tags are found then initial version is set to 1.0.0
- production-branch: The branch to use for release to production. Default is master
- version: The new version that was created and tagged in the format of <major>.<minor>.<build>[-<dev>]
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Version
id: version
uses: jivanpuri/get-version@v1
with:
production-branch: master