Skip to content
package

GitHub Action

Check Version

v1 Latest version

Check Version

package

Check Version

Verifies that the version number (in a pull request) was bumped by comparing it to the prevous version from base branch.

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Check Version

uses: kriasoft/check-version@v1

Learn more about this action in kriasoft/check-version

Choose a version

Check Version Action for GitHub

Verifies that the version number (in a pull request) was bumped by comparing it to the prevous version from the base branch.

Usage

See action.yaml

Basic
name: api
on:
  pull_request:
    paths:
      - "api"
      - "!README.md"
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: kriasoft/check-version@v1
        with: { path: "api" }

Full

name: api
on:
  pull_request:
    paths:
      - "api"
      - "!README.md"
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - id: pkg
        uses: kriasoft/check-version@v1
        with:
          path: "api"
          format: "{name}_v{version}+build.{pr_number}.zip"

      - run: |
          echo "name: ${{ steps.pkg.outputs.name }}"
          echo "version: ${{ steps.pkg.outputs.version }}"
          echo "release: ${{ steps.pkg.outputs.release }}"
        #
        # Prints:
        #   name: api
        #   version: 0.1.3
        #   release: api_v0.1.3+build.549.zip

License

The scripts and documentation in this project are released under the MIT License.