Skip to content
tag

GitHub Action

Semver Release by Label

v2.3.0 Latest version

Semver Release by Label

tag

Semver Release by Label

Automatically create Semver compliant tags or releases based on PR labels

Installation

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

              

- name: Semver Release by Label

uses: krogon/[email protected]

Learn more about this action in krogon/semver-release-action

Choose a version

Semver Release Github Action badge

Fork information

Based on https://github.com/K-Phoen/semver-release-action

Additions:

  • default_increment - default increment bump when label is not found, default "skip"
  • tag_format - allows to use prefix/suffix in the format to manage separate components in monorepo

Description

Automatically create SemVer compliant releases based on PR labels.

Assuming that a PR is tagged with a "semver-compliant" label (patch, minor or major), then this action can create a tag and a GitHub release when it is merged.

Note: to determine the base tag for the increment, this action will try to find the most recent tag complying to SemVer. No additional setup is required.

Inputs

release_branch

Required Branch to tag. Default "master".

release_strategy

Required Release strategy. Default "release" (release: creates a GitHub release ; tag: creates a lightweight tag ; none: computes the next SemVer version but does not create a release or tag).

default_increment

Required Default increment (skip/patch/minor/major). Default "skip".

tag_format

Optional Format used to create tags. Default "v%major%.%minor%.%patch%".

tag

Optional Tag to use. If left undefined, it will be computed using the tags already present in the repository.

Outputs

tag

The newly created tag.

Example usage

# .github/workflows/release.yml
name: Release

on:
  pull_request:
    types: [closed]

jobs:
  build:
    runs-on: ubuntu-latest

    if: github.event.pull_request.merged
    
    steps:
      - name: Tag
        uses: krogon/semver-release-action@master
        with:
          release_branch: master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

License

This library is under the MIT license.