如何通过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

```

相关推荐
本地化文档25 分钟前
black-docs-l10n
python·github·gitcode·sphinx
代码钢琴师1 小时前
从零设计一个 Java 分布式限流库:throttle4j 架构解析
github
用户065128196331 小时前
Go开发者的工具箱:gookitgoutil,900+实用函数汇集
github
DogDaoDao1 小时前
【GitHub】AutoGPT 深度技术解析:开源自主 AI Agent 平台架构全解
人工智能·程序员·开源·github·ai编程·ai agent·智能体
SUNNY_SHUN2 小时前
把 Whisper、Moonshine、SenseVoice 统统装进手机:sherpa-onnx 离线语音部署框架,GitHub 10.9K Star
人工智能·智能手机·whisper·github
DogDaoDao2 小时前
【GitHub】Hermes Agent 深度技术分析
程序员·大模型·github·ai编程·ai agent·智能体·hermers agent
沉默王二3 小时前
阿里云 OCR+LiteParse,让扫描件 PDF 也能被 RAG 检索到!
github·agent·ai编程
X_szxj4 小时前
Windows安装liboqs库
windows·github
AdCj34 小时前
GitHub 日榜速递 (2026-06-08):AI 基础设施正在“下沉“(技术分析版)
人工智能·github·agent
CJH(本人账号)4 小时前
AI Agent 安全危机:当你的“智能助手“变成攻击者的“远程武器“
网络·人工智能·安全·ai·开源·github