【问题标题】:dir: cannot access in azure devops pipelinedir:无法在 azure devops 管道中访问
【发布时间】:2021-01-22 16:19:09
【问题描述】:

每次我运行我的 devops 管道时,我都会不断收到 dir: cannot access "..." 错误消息。我不知道为什么会这样。

这是我的管道代码:

---
resources:
  repositories:
  - repository: testrepo
    type: github
    endpoint: testendp
    name:  testrepo/data

trigger:
- none
pool:
  name: Hosted Ubuntu 1604
steps:
- checkout: testrepo
- script: dir $(Build.SourcesDirectory)
      data=$(jq 'to_entries | map(select(.value.isdata=="true")) | from_entries' datafiles.json )
      echo "$data" 

但我总是收到dir: cannot access "..." 错误。

【问题讨论】:

  • 在代码中,脚本应该是一个 bash 脚本。在您的输出中,它是一个 powershell。怎么会?
  • 嗨@rayaurelius,刚刚签到看看这个问题是否仍然阻碍你?这个问题有更新吗?

标签: azure azure-devops yaml azure-pipelines


【解决方案1】:

打开项目设置->设置->选中将作业授权范围限制为当前项目以用于非发布管道和将作业授权范围限制为引用的 Azure DevOps 存储库。

您可以参考此doc 了解更多详情。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-30
    • 2019-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多