【问题标题】:Triggering a Release pipeline when adding git tag in Github在 Github 中添加 git 标签时触发发布管道
【发布时间】:2021-09-15 09:33:33
【问题描述】:

我想在 Github 中添加 git 标签时自动触发 Azure 发布管道。

我尝试在工件的持续部署触发器上指定为分支:

  • /refs/tags/*
  • *

但是这两个选项都不会在创建 git 标签时触发发布。

当我使用* 作为触发过滤器并将提交推送到例如我的仓库的master 分支我能够触发发布管道。

我在这里遗漏了什么,还是 Azure DevOps 限制?

【问题讨论】:

  • 不是重复的,不同的是这是关于发布管道而不是像其他地址那样构建管道
  • 上周向所有 Azure Repo 推出了用于推送新分支的修复程序。这可能也解决了这个问题。

标签: git github azure-devops azure-pipelines


【解决方案1】:

一种方法是使用Azure/pipelines GitHub Action 来触发 Azure Pipeline。

支持这一点的行动已在Azure DevOps Sprint 161 release notes 中宣布

一个example is available on GitHub,有趣的是:

 deploy-using-azure-pipelines:
    runs-on: ubuntu-latest
    steps:
    - name: 'Trigger an Azure Pipeline to deploy the app to PRODUCTION'
      uses: Azure/pipelines@releases/v1
      with:
        azure-devops-project-url: 'https://dev.azure.com/OrganizationName/ProjectName'
        azure-pipeline-name: 'WebApp_Azure_Prod' 
        azure-devops-token: '${{ secrets.AZURE_DEVOPS_TOKEN }}'

您需要更改 URL 并在具有 Azure DevOps 个人访问令牌的 GitHub 项目中创建一个名为 AZURE_DEVOPS_TOKEN 的机密。

您的 GitHub Action 工作流程的触发器可以使用类似于 Trigger Github Action only on new tags? 中的答案的东西

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-24
    • 2022-11-14
    • 2016-11-18
    • 1970-01-01
    • 2021-10-19
    • 1970-01-01
    • 2020-12-05
    • 2023-03-05
    相关资源
    最近更新 更多