dir:无法在azure devops管道中访问

时间:2020-10-07 16:45:24

标签: azure azure-devops yaml azure-pipelines

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

Error screenshot

这是我的管道代码:

---
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 "..."错误。

1 个答案:

答案 0 :(得分:0)

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

您可以参考此doc以获得更多详细信息。

enter image description here