•  


git-next-tag · Actions · GitHub Marketplace · GitHub
Skip to content
tag

GitHub Action

git-next-tag

v0.4.2 Latest version

git-next-tag

tag

git-next-tag

Make a new git tag name based on git history. This action strictly follows Conventional-Commits / SemVer specifications.

Installation

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

              

- name: git-next-tag

uses: ldelarue/git-next-tag@v0.4.2

Learn more about this action in ldelarue/git-next-tag

Choose a version

git-next-tag

CI

This tool generates a new git tag from those already in your project git history.

Tag calculation is based on conventional commit and semantic versioning .

Motivation

I wanted a simple tool with very little configuration that would guarantee the consistency of the versions included the git tags of my projects.

I had not found a tool that do the followings tasks combined in an elegant way:

  • Follows conventional commit specifications with the greatest assiduity .
  • Uses semantic versioning for non-JavaScript based projects.
  • Manage project versioning and release cycle using Git as source of truth .
  • Implements a CI without a config file , only via GitHub Actions and Git configuration.
  • Can handle ZeroVer and SemVer with a minimum of automation .
  • Manages an opinionated logic on SemVer prerelease increments .

Maybe it does exist. If in doubt, give this project a try. ??

Prerequisites

  • The current branch using the Action MUST have a linear git history.
  • Before the first start, it is necessary to add a version tag in the git-history consistent with the action configuration.

Example of command to create a git tag on the first commit of a project:

git switch main
git tag v0.0.0 
$(
git rev-list --max-parents=0 HEAD
)

git push origin v0.0.0

Usage

  • This action needs to retrieve the entire git history of the project using to actions/checkout .
  • contents: read permission is required to access the repository content in order to retrieve git-related information (commits, tags, etc).

Here's an example configuration:

jobs
:  
  
get-new-tag
:
    
runs-on
: 
['ubuntu-latest']

    timeout-minutes
: 
5


    permissions
:
      
contents
: 
read


    steps
:
      - 
uses
: 
actions/checkout@v4

        with
:
          
fetch-depth
: 
0


      - 
id
: 
calculate_next_version

        uses
: 
ldelarue/git-next-tag@v0

        with
:
          
tag-prefix
: 
v


      - 
shell
: 
bash

        run
: 
|

          echo "::notice::Generated tag is '${{ steps.calculate_next_version.outputs.tag }}'"

Tip

Please read action.yml for more details on parameters and output values.

In this example:

  • My only tag in my git history is v0.0.0 .
  • I pushed a commit named feat: this is an example that triggered this job.

So the resulted tag is v0.1.0 .

Give it a try! And see what your Action prints in its logs! ??

More examples and tutorials

Contributions

Please read the dedicated file for setup and project management.

Thanks for your interest! ??

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본