Skip to content
play

GitHub Action

Latest & Previous Tag

latest Latest version

Latest & Previous Tag

play

Latest & Previous Tag

Get latest and previous tag from a repository

Installation

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

              

- name: Latest & Previous Tag

uses: JinoArch/get-latest-tag@latest

Learn more about this action in JinoArch/get-latest-tag

Choose a version

get-latest-tag

Produces 2 outputs. Latest and previous output as follows

${{ steps.jinos.outputs.latestTag }}
${{ steps.jinos.outputs.previousTag }}

How to use?

- name: NewTag
  id: tag
  uses: JinoArch/get-latest-tag@latest

An example to get changelog

- name: changelog
  id: changelog
  run: |
    echo "changelog=$(git log "${{ steps.tag.outputs.previousTag }}...${{ steps.tag.outputs.latestTag }}" --pretty=format:"- <http://github.com/rewards-guilds/kensho/commit/%H|%h> - %s\n" | awk '{print}' ORS=' ')" >> $GITHUB_OUTPUT