Skip to content

How to get just the tag name? #26686

Answered by juttayaya
svenstaro asked this question in Actions
Sep 13, 2019 · 22 comments · 16 replies
Discussion options

You must be logged in to vote

Since this page shows up surprisingly high in Google search , here is the 2022 answer in "How to get a tag name in GitHub Actions"

on:
  push:
    tags:
      - '*'
jobs:
  github-example-tags:
    steps:
     - name: GitHub Tag Name example
       run: |
         echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
         echo "Tag name from github.ref_name: ${{  github.ref_name }}"

https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables

Replies: 22 comments 16 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lordofscripts
Comment options

Comment options

You must be logged in to vote
1 reply
@lordofscripts
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JadenYangCA
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@chaderick9
Comment options

@fredrikthorkildsen
Comment options

@Courtcircuits
Comment options

@hendisantika
Comment options

@lordofscripts
Comment options

Answer selected by svenstaro
Comment options

You must be logged in to vote
1 reply
@lordofscripts
Comment options

Comment options

You must be logged in to vote
4 replies
@lordofscripts
Comment options

@lordofscripts
Comment options

@JetpackDuba
Comment options

@lordofscripts
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD