A simple action that returns the current/next major, minor, and patch version based on the given semver version.
inputs:
bump_level:
description: "Version bump level [major, minor, patch]."
required: False
default: "patch"
verbose:
description: "Print current and next version."
required: False
default: "false"
frail:
description: "Return exit code of 1 when no version tag is found."
required: False
default: "false"
outputs:
current_version:
description: "The current version."
next_version:
description: "The next major version."
error:
descriptor: "Whether an error was encountered when retrieving the current semver."
name: release
on:
push:
branches:
- main
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: rickstaa/action-get-semver@v1
id: get_semver
with:
bump_level: "minor"
- name: Print current and next version
run: |
echo "Current version: ${{ steps.get_semver.outputs.current_version }}"
echo "Next version: ${{ steps.get_semver.outputs.next_version }}"
❗ NOTE: This action requires the fetch-depth: 0
argument to be set in the actions/checkout@v3 step (see actions/checkout#fetch-all-history-for-all-tags-and-branches
).
Feel free to open an issue if you have ideas on how to make this GitHub action better or if you want to report a bug! All contributions are welcome. 🚀 Please consult the contribution guidelines for more information.
This action serves as a wrapper around the bump package of @haya14busa.