相关疑难解决方法(0)

Azure 管道不允许 git push 需要抛出“GenericContribute”权限

我正在尝试使用cmd组件推送在 Azure 管道期间完成的一些更改,如下所示,

steps:
- script: |
   git config user.email you@you.com
   git config user.name "your name"
   git diff
   git  add .
   git commit -m "version update [skip ci]"
   git push origin HEAD:master
Run Code Online (Sandbox Code Playgroud)

但它无法显示以下错误。

远程:0000000000aaTF41027:您需要 Git 'GenericContribute' 权限才能执行此操作。详细信息:身份'Build\sdfdfjjkk',范围'repository'

我已经设置了必要的权限如下:

在此处输入图片说明

并且Allow scripts to access the OAuth token还启用了此处提到的

我还需要哪些其他权限才能使其工作?

git azure-devops azure-pipelines-build-task azure-pipelines

23
推荐指数
3
解决办法
2万
查看次数

Azure Pipeline,无法提示,因为终端提示已被禁用

我正在尝试将管道设置为仅签出与项目相关的特定文件夹,以便减少签出时间。

我正在使用在许多其他问题上找到的以下代码,但我似乎无法让它工作。

- script: |
    cd $(Build.SourcesDirectory)

    git init
    git remote set-url origin $(Build.Repository.Uri)
    git config core.sparsecheckout true

    echo STARS/Source/ >> .git/info/sparse-checkout

    git pull origin $(Build.SourceBranch)
  displayName: 'Project Specific Checkout'
  env:
    SYSTEM_ACCESSTOKEN: $(System.AccessToken)

Run Code Online (Sandbox Code Playgroud)

我不断在日志中收到以下错误:

Reinitialized existing Git repository in C:/Agent001/_work/20/s/.git/
fatal: Cannot prompt because terminal prompts have been disabled.
fatal: could not read Password for 'https://organization@dev.azure.com/...': terminal prompts disabled
Run Code Online (Sandbox Code Playgroud)

我似乎无法弄清楚如何启用终端提示。

更新:

根据@Repcak 评论,我更新了代码,但仍然收到错误terminal prompts have been disabled

git cmd azure azure-pipelines

10
推荐指数
2
解决办法
3万
查看次数