无法从 AppCenter 构建管道对 Azure DevOps Artifacts 提要进行身份验证

问题描述

我有一个构建在 appcenter 上的 ReactNative iOS 应用程序,它无法访问 Azure DevOps Artifacts 上的 npm Feed。以下是该项目的工件。我尝试了所有方法,但没有发现问题。

项目根目录 .npmrc

@scope:registry=https://pkgs.dev.azure.com/org/_packaging/Feed-name/npm/registry/

appcenter-post-clone.sh

# PACKAGES_READ_PASSWORD is PAT with packages read & write persmissions

PACKAGES_READ_PASSWORD_BASE64=$(echo ${PACKAGES_READ_PASSWORD} | base64)

cat >> ${HOME}/.npmrc << EOF

; begin auth token
//pkgs.dev.azure.com/org/_packaging/Feed-name/npm/registry/:username=org
//pkgs.dev.azure.com/org/_packaging/Feed-name/npm/registry/:_password=${PACKAGES_READ_PASSWORD_BASE64}
//pkgs.dev.azure.com/org/_packaging/Feed-name/npm/registry/:[email protected]

//pkgs.dev.azure.com/org/_packaging/Feed-name/npm/:username=org
//pkgs.dev.azure.com/org/_packaging/Feed-name/npm/:_password=${PACKAGES_READ_PASSWORD_BASE64}
//pkgs.dev.azure.com/org/_packaging/Feed-name/npm/:[email protected]
; end auth token
EOF

在 npm install 阶段,这是输出

npm ERR! code E401
npm ERR! Unable to authenticate,need: Basic realm="https://pkgsprodsu3weu.app.pkgs.visualstudio.com/"

我正在使用以下机器配置运行管道

Agent name: 'Hosted Agent'
Agent machine name: 'Mac-1622549610698'
Current agent version: '2.187.1'
##[group]Operating System
Mac OS X
10.15.7
19H1217
##[endgroup]
##[group]Virtual Environment
Environment: macos-10.15
Version: 20210525.2
Included Software: https://github.com/actions/virtual-environments/blob/macOS-10.15/20210525.2/images/macos/macos-10.15-Readme.md
Image Release: https://github.com/actions/virtual-environments/releases/tag/macOS-10.15%2F20210525.2
##[endgroup]
Current image version: '20210525.2'
Agent running as: 'runner'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: PowerShell (2.186.0)
Downloading task: ShellScript (2.165.2)
Downloading task: Bash (3.182.0)
Downloading task: CmdLine (1.1.3)
Downloading task: CmdLine (2.182.0)
Downloading task: InstallAppleCertificate (2.186.0)
Downloading task: InstallAppleProvisioningProfile (0.124.0)
Downloading task: CocoaPods (0.186.0)
Downloading task: Xcode (4.130.0)
Downloading task: copyFiles (2.186.1)
Downloading task: PublishBuildArtifacts (1.186.0)

感谢您的帮助

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)