如何通过GitHub Actions来触发AzureDevOps Pipeline

由于无法控制的原因,您可能在ADO (AzureDevOps)中有一个构建或发布管道,您想从GitHub触发。事实证明,Azure已经发布了一个操作来做到这一点!你可以在这里找到它:@Azure/pipelines

如何使用 @Azure/pipelines action

首先,您需要创建一个个人访问令牌(PAT),该令牌具有触发ADO管道的权限。您可以通过访问azure开发组织主页来完成此操作。打开用户设置>选择个人访问令牌>点击生成新令牌>选择所需的权限>单击Create。您需要授予令牌Release: Read, write, & execute和/或Build: Read & execute权限(取决于您的管道是触发Build还是Release)。有关pat以及如何创建pat的详细说明,请参阅官方文档:创建个人访问令牌

一旦你有了你的PAT,你需要把它添加到你的GitHub存储库的秘密。要做到这一点,请到您的GitHub存储库>设置在秘密的在行动比;添加一个新秘密。然后输入:

  • Name: ADO_PAT
  • Secret: <paste your PAT here>

然后在你的GitHub工作流文件中,你可以使用这样的动作:

```

复制代码
- name: Trigger ADO pipeline
  uses: Azure/pipelines@v1.2
  with:
    azure-devops-project-url: 'https://dev.azure.com/<org>/<project>' # Replace with your ADO project URL
    azure-pipeline-name: '<your ado pipeline name>' # Replace with your pipeline name
    azure-devops-token: '${{ secrets.ADO_PAT }}' # This is the PAT secret you created above
    azure-pipeline-variables: '{"accessLevel": "public", "<optional-pipeline-variable>": "<variable-value>"}' # These are optional

```

相关推荐
haluhalu.4 小时前
prompts.chat:03-core-prompting-principles
prompt·github
阿里嘎多学长17 小时前
2026-07-10 GitHub 热点项目精选
开发语言·程序员·github·代码托管
今夕资源网1 天前
AI声音克隆软件 CosyVoice今夕一键整合包解压即用 阿里巴巴通义实验室开源 github斩获22K星标
人工智能·github·多国语言·声音克隆·零样本语音克隆·感情·ai语音克隆
胡萝卜术1 天前
从聊天模型到本地执行助手:Remote MCP 多工具 Agent 实战
面试·架构·github
慕容引刀1 天前
告别Commit信息纠结:使用Git AI Commit插件实现规范化提交
人工智能·git·github·visual studio code·visual studio
GoGeekBaird2 天前
我开源了 BeeWeave,给 AI Agent 搭一个越用越懂你的知识创作台
后端·github
fthux2 天前
GitZip Pro 源码解析:一个 GitHub 文件/文件夹下载扩展是如何工作的(一)整体架构与扩展入口
人工智能·ai·开源·github·open source
第一程序员2 天前
Rust Agent 子进程执行:Command 之前,先定义输入和超时
python·rust·github
2501_936960362 天前
GitHub初步了解
github
wangruofeng2 天前
11 万 Star 的生成式 AI 入门课,Microsoft 做对了什么
github·aigc·ai编程