Skip to content

A Github Action which determines a release tag from a Git repository using "latest" tags

License

Notifications You must be signed in to change notification settings

flownative/action-git-latest-release

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Latest Release Github Action

This Github action looks for a commit tagged as "latest" in the current Git repository and tries to determine a version Git tag (one prefixed with "v") for that commit.

In short, if you have a commit which is tagged as "v1.2.5+3", which is also tagged as "latest", this action will return "v1.2.5+3" as its "tag" output.

Additionally, this action also returns just the version number as a dedicated output. In the example above, "version" will contain "1.2.5".

Example workflow

name: Rebuild latest release
on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:

      - uses: actions/checkout@v2
        with:
          ref: 'latest'

      - name: Determine latest released version
        id: latest_version
        uses: flownative/action-git-latest-release@v1

      - name: Build Docker image
        uses: flownative/action-docker-build@v1
        with:
          tag_ref: ${{ steps.latest_version.outputs.tag }}
          image_name: flownative/docker-base/base
          registry_password: ${{ secrets.GITHUB_TOKEN }}