Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access github tag message in github actions

I want to capture the github tag message in Github Actions.

If user pushes tag with some message e.g.

git tag -a 1.0.0 -m "Test Message"

than, I would like to capture that message("Test Message") inside the github actions.

Any help or reference is much appreciated.

like image 889
Nitin Singh Avatar asked Sep 11 '25 00:09

Nitin Singh


1 Answers

If you are not able to run git command through github actions. Validate the checkout log, you should have something like this

git version 2.17.1 
Deleting the contents of <YOUR REPO> 
The repository will be downloaded using the GitHub REST API 
To create a local Git repository instead, add Git 2.18 or higher to the PATH
Downloading the archive Writing archive to disk Extracting the archive

Install the latest version of git as per your requirement. I have used PPA to install on ubuntu self hosted runner. Once version issue is fixed and github action is cloning the repo instead of downloading through rest api. Than use below command

git fetch --depth=1 origin +refs/tags/*:refs/tags/*
git tag -l --format='%(contents:subject)' ${GITHUB_REF#refs/*/}
like image 182
Nitin Singh Avatar answered Sep 13 '25 16:09

Nitin Singh