Skip to content

Get release or tag (SHA)

Actions
Gets the release tag if it exists, otherwise returns the commit id (SHA)
v2
Latest
Star (0)

Get release or tag (SHA)

Action test on Ubuntu Action test on MacOs Action test on Windows Release Demo

Github action to get the release tag if it exists, otherwise returns the commit id (SHA).

Supported runners: ubuntu, macos, windows

Usage

Public workflows that use this action.

Basic

steps:
   - uses: actions/checkout@v3

   - id: tag
     uses: GuillaumeFalourd/get-release-or-tag@v2

   - name: TAG
     run: echo "TAG ${{ steps.tag.outputs.tag }}"

With Docker images

This action can for example helps you get release docker images in a dev/prod pipeline. It will return the release name ($GITHUB_REF without refs/tags/) if the action is release otherwise it will return $GITHUB_SHA

name: Publish

on:
  release:
    types:
      - published

jobs:
  build_docker_image:
    name: Flyway
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: GuillaumeFalourd/get-release-or-tag@v2
        id: tag

      - name: Build
        run: docker build src/flyway -t your.docker.repo/flyway:${{ steps.tag.outputs.tag }}

      - name: Push
        run: docker push your.docker.repo/flyway:${{ steps.tag.outputs.tag }}

Action Outputs

Field How to access Observation
tag ${{ steps.<step-id>.outputs.tag }} Contains last release tag or SHA

🤝 Contributing

Guidelines

🏅 Licensed

☞ This repository uses the Apache License 2.0

Get release or tag (SHA) is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Gets the release tag if it exists, otherwise returns the commit id (SHA)
v2
Latest

Get release or tag (SHA) is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.