简体   繁体   English

如何在 github 操作中访问 github 标签消息

[英]How to access github tag message in github actions

I want to capture the github tag message in Github Actions.我想在 Github 操作中捕获 github 标记消息。

If user pushes tag with some message eg如果用户推送带有一些消息的标签,例如

git tag -a 1.0.0 -m "Test Message"

than, I would like to capture that message("Test Message") inside the github actions.比,我想在 github 动作中捕获该消息(“测试消息”)。

Any help or reference is much appreciated.非常感谢任何帮助或参考。

If you are not able to run git command through github actions.如果您无法通过 github 操作运行 git 命令。 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.根据您的要求安装最新版本的 git。 I have used PPA to install on ubuntu self hosted runner.我已经使用PPA安装在 ubuntu 自托管运行器上。 Once version issue is fixed and github action is cloning the repo instead of downloading through rest api.一旦版本问题得到修复并且 github 操作将克隆存储库,而不是通过 rest api 下载。 Than use below command比使用以下命令

git fetch --depth=1 origin +refs/tags/*:refs/tags/*
git tag -l --format='%(contents:subject)' ${GITHUB_REF#refs/*/}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM