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

How to access github tag message in github actions

我想在 Github 操作中捕获 github 标记消息。

如果用户推送带有某些消息的标签,例如

git tag -a 1.0.0 -m "Test Message"

然后,我想在 github 操作中捕获该消息(“测试消息”)。

非常感谢任何帮助或参考。

如果您无法通过 git 集线器操作 运行 git 命令。验证结帐日志,你应该有这样的东西

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

根据您的要求安装最新版本的 git。我已经使用 PPA 在 ubuntu 自托管 运行 上安装。 一旦版本问题得到解决并且 github 操作将克隆 repo 而不是通过 rest api 下载。比使用下面的命令

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