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/*/}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…