Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 2.73 KB

README.md

File metadata and controls

70 lines (46 loc) · 2.73 KB

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