rndmh3ro / version-drafter-action

📈Github Action that determines the next semantic version based on pull request labels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

version-drafter-action

License: ISC Tests

GitHub Action designed as companion for release-drafter to determine the next semantic version based on the github labels of merged pull requests

Usage

To use the action, create a yaml file ( i.e. version.yml ) in your .github/workflows folder

Standalone example

name: Update Releaseinfo
on:
  push:
    # branches to consider in the event; optional, defaults to all
    branches:
      - master

jobs:
  update_version:
    runs-on: ubuntu-latest
    steps:
      - name: calculate next version
        id: version
        uses: patrickjahns/version-drafter-action@v1
        with:
          # (Optional) specify config name to use, relative to .github/. Default: version-drafter.yml
          # config-name: my-config.yml
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: echo calculated version
        run: |
          echo "version: ${{ steps.version.outputs.next-version }}"

With release-drafter

name: Update Releaseinfo
on:
  push:
    branches:
      - master

jobs:
  update_version:
    runs-on: ubuntu-latest
    steps:
      - name: calculate next version
        id: version
        uses: patrickjahns/version-drafter-action@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - uses: release-drafter/release-drafter@master
        with:
          version: ${{ format('v{0}', steps.version.outputs.next-version) }}
          tag: ${{ format('v{0}', steps.version.outputs.next-version) }}
          name: ${{ format('v{0}', steps.version.outputs.next-version) }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Configuration

The action determines the next semantic version based on github labels. The mapping of the labels can be configured by providing a yaml configuration (usually at .github/version-drafter.yml)

major-labels: ['semver:major']
minor-labels: ['semver:minor','enhancement']
patch-labels: ['semver:patch','bug']

Output

The action will output the calculated next semantic version as next-version, as well as the current tag as current-version

About

📈Github Action that determines the next semantic version based on pull request labels

License:ISC License


Languages

Language:JavaScript 91.3%Language:Dockerfile 8.7%