百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

github-action-get-previous-tag

> 开发工具
开源

获取上一个标签

196 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

获取上一个标签

Get previous tag

GitHub Action that gets the latest tag from Git

Input

By default, this action will fail if no tag can be found and no fallback is provided; when set, the fallback tag will be used instead. Keep in mind that when this action is used in a workflow that has no .git directory, it will still fail, and the fallback tag isn't used. It is also accepts a pattern string to query the tags based on it. Pattern to query the tag by this can be semver (v*[0-9].*[0-9].*[0-9]) or a simple monotonically increasing integer (r*) and defaults to * And finally it takes a workingDirectory if you need to look for a tag in an alternative path.

  • fallback: 1.0.0
  • pattern: v*[0-9].*[0-9].*[0-9]
  • workingDirectory: another/path/where/a/git/repo/is/checked/out

Output

This action has two outputs, tag for the found tag, or the fallback. And, timestamp as a UNIX Epoch timestmap for when the tag was created, or when no tag is found, and a fallback tag has be specific is provides the timestamp of action execution.

  • tag: 1.2.3
  • timestamp: 123

Example

Find more examples in the examples directory.

The following example works together with the WyriHaximus/github-action-next-semvers and WyriHaximus/github-action-create-milestone actions. Where it provides the previous tag from that action so it can supply a set of versions for the next action, which creates a new milestone. (This snippet has been taken from the automatic code generation of wyrihaximus/fake-php-version.)

…

License

Copyright 2026 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptactiongitgithubgithub-actions

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具