Skip to content

Latest commit

 

History

History
76 lines (63 loc) · 2.88 KB

README.md

File metadata and controls

76 lines (63 loc) · 2.88 KB

action-get-semver

A simple action that returns the current/next major, minor, and patch version based on the given semver version.

Action test Depup Release Docker Image CI GitHub release (latest SemVer)

Inputs

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

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."

Usage

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 ).

Contributing

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.

Acknowledgement

This action serves as a wrapper around the bump package of @haya14busa.