Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
231 views
in Technique[技术] by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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/*/}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...