github - 仅在新标签上触发 Github Action?

标签 github github-actions

是否有可能仅在推送新版本(带有新标签)时触发 github 操作?我不想在每次推送到 master 时运行它们,但我也想避免创建发布分支。

最佳答案

使用以下语法:

on:
  push:
    # Pattern matched against refs/tags
    tags:        
      - '*'           # Push events to every tag not containing /
对于分层标签:
on:
  push:
    # Pattern matched against refs/tags
    tags:        
      - '**'           # Push events to every tag including hierarchical tags like v1.0/beta
https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags

关于github - 仅在新标签上触发 Github Action?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61891328/

相关文章:

GitHub页面 'Your connection is not private'

Git 日志 : list all parents commits

GitHub Actions 无法通过 SSH 加载,尽管它似乎使用 ssh-access 工作

git - 将 github 操作工件上传到最新版本

reactjs - 包含 Github Actions 的 env 文件

git - Git 和 GitHub 的区别

Git:如何查看两个远程分支的不同之处?

javascript - 如何在 npm 安装期间将 fork 的存储库更新为依赖项?

r - Github Action 不是在 Push 上运行,而是按计划运行

github - 如何使用 Github Actions API 获取 Github 工作流程 yaml 文件