Skip to content

Github Action to get release / tag (this fork updates the output syntax and gives support to all OS runners)

License

Notifications You must be signed in to change notification settings

GuillaumeFalourd/get-release-or-tag

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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