Giter Club home page Giter Club logo

next-version's Introduction

next-version

A GitHub Action for calculating the next version based on conventional commits.

Usage

To use the GitHub Action, add the following to your job:

- id: version
  uses: conventional-actions/next-version@v1

Inputs

Name Default Description
prefix v prefix to prepend to versions
tag-prefix v specify a prefix for the git tag to be ignored from the semver checks
path . filter commits to the path provided
skip-unstable false if true, unstable tags (e.g. x.x.x-alpha.1, x.x.x-rc.2) will be skipped

Outputs

Name Example Description
release-type none, major, minor, patch, prerelease type of release
current-version v1.2.3rc2 the current version
current-version-major v1 the major version
current-version-minor v1.2 the major and minor version
current-version-patch v1.2.3 the major, minor and patch version
current-version-major-only 1 the major version component
current-version-minor-only 2 the minor version component
current-version-patch-only 3 the patch version component
current-version-prerelease-only rc2 the prerelease version only
version v1.2.4 the new version
version-major v1 the major version
version-minor v1.2 the major and minor version
version-patch v1.2.4 the major, minor and patch version
version-major-only 1 the major version component
version-minor-only 2 the minor version component
version-patch-only 4 the patch version component
version-prerelease-only rc2 the prerelease version only
bumped true, false true if the version has been bumped

Environment variables

Name Example Description
VERSION_RELEASE_TYPE none, major, minor, patch, prerelease type of release
CURRENT_VERSION v1.2.3rc2 the current version
CURRENT_VERSION_MAJOR v1 the major version
CURRENT_VERSION_MINOR v1.2 the major and minor version
CURRENT_VERSION_PATCH v1.2.3 the major, minor and patch version
CURRENT_VERSION_MAJOR_ONLY 1 the major version component
CURRENT_VERSION_MINOR_ONLY 2 the minor version component
CURRENT_VERSION_PATCH_ONLY 3 the patch version component
CURRENT_VERSION_PRERELEASE_ONLY rc2 the prerelease version only
VERSION v1.2.4 the new version
VERSION_MAJOR v1 the major version
VERSION_MINOR v1.2 the major and minor version
VERSION_PATCH v1.2.4 the major, minor and patch version
VERSION_MAJOR_ONLY 1 the major version component
VERSION_MINOR_ONLY 2 the minor version component
VERSION_PATCH_ONLY 4 the patch version component
VERSION_PRERELEASE_ONLY rc2 the prerelease version only
VERSION_BUMPED true, false true if the version has been bumped

Example

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - id: version
        uses: conventional-actions/next-version@v1
      - if: ${{steps.version.bumped}} == true
        run: |
          echo ${{steps.version.version}} > VERSION

License

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

next-version's People

Contributors

sethyates avatar hanpeter avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.