最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

git - Is the --commitId optional at the `az pipelines run` command? - Stack Overflow

programmeradmin8浏览0评论

I am trying to run a pipeline from the command line in powershell and these are the commands used:

$targetBranch = master
$versionTag = "12.1.3456"
az pipelines run --anization "/" --project "ProjectName" --id 1234 --branch=$targetBranch --parameters "baseTag=$versionTag"

But I am getting this error: A value for the 'commitId' parameter must be provided.

Which does not make so much sense because on the az pipelines run documentation says that the commitId is optional, and they even have an example without this parameter:

Example:

az pipelines run --name myGithubname.pipelines-java --branch pipeline --variables var1=100 --output table

Also, this script is called from a pipeline in a different repository so I cannot get the last commit id from a command like git rev-parse HEAD

Is there a way to run the pipeline without the commitId parameter?

Thank you :)

I am trying to run a pipeline from the command line in powershell and these are the commands used:

$targetBranch = master
$versionTag = "12.1.3456"
az pipelines run --anization "https://dev.azure/anization/" --project "ProjectName" --id 1234 --branch=$targetBranch --parameters "baseTag=$versionTag"

But I am getting this error: A value for the 'commitId' parameter must be provided.

Which does not make so much sense because on the az pipelines run documentation says that the commitId is optional, and they even have an example without this parameter:

Example:

az pipelines run --name myGithubname.pipelines-java --branch pipeline --variables var1=100 --output table

Also, this script is called from a pipeline in a different repository so I cannot get the last commit id from a command like git rev-parse HEAD

Is there a way to run the pipeline without the commitId parameter?

Thank you :)

Share Improve this question asked Mar 27 at 2:22 Caro CardozoCaro Cardozo 33 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

commitId isn't a required parameter. I have tested your script in my pipeline and it works fine, the target pipeline has been triggered without any issue.

pool:
  vmImage: windows-latest

steps:
- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      $versionTag = "12.1.3456"
      az pipelines run -- "https://dev.azure/{OrgName}/" --project "{ProjName}" --id 510 --branch "main" --parameters "baseTag=$versionTag"
  env:
    AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)

As shown in the screenshot, my target pipeline was triggered by Project Collection Build Service account since I am using System.AccessToken for authentication in Azure DevOps CLI.

发布评论

评论列表(0)

  1. 暂无评论