术语' pullrequest.pullrequestnumber'不被认为是CMDLET,功能,脚本文件或

发布于 2025-02-12 06:47:43 字数 342 浏览 3 评论 0原文

我正在尝试获取拉动请求ID,但请继续 术语“ system.pullrequest.pullrequestnumber”不被认为是cmdlet的名称 我还尝试了system.pullrequest.pullrequestnumber,但是

使用Azure Devops Pipleine yaml文件,我的错误是我的错误,而仓库位于github中

steps:
- powershell: |
    #write-host $(System.PullRequest.PullRequestId)
    write-host $(System.PullRequest.PullRequestNumber)

I am trying to get the Pull Request ID but keep getting
The term 'System.PullRequest.PullRequestNumber' is not recognized as a name of a cmdlet
I have also tried System.PullRequest.PullRequestNumber but same error

Im using Azure devops pipleine yaml file and the repo is in Github

steps:
- powershell: |
    #write-host $(System.PullRequest.PullRequestId)
    write-host $(System.PullRequest.PullRequestNumber)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蹲墙角沉默 2025-02-19 06:47:45

您是否添加了pr触发器(请参阅文档)?

我已经在GitHub创建了一个仓库,这是我的示例管道(也在GitHub中)

pr:
- main

steps:
- powershell: Write-Host "$(System.PullRequest.PullRequestNumber)"

,我从Azure Devops配置了管道,当我创建针对主分支的PR时,它将成功运行:

Did you add the pr trigger (see documentation)?

I've created a repo in github and here is my sample pipeline (In Github as well)

pr:
- main

steps:
- powershell: Write-Host "$(System.PullRequest.PullRequestNumber)"

I've configured the pipeline from Azure Devops and when I create a PR targeting the main branch, it runs successfully:
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文