bar*_*iro 3 artifactory npm-registry github-actions
这个问题包括一个特定的用例:
@myscope/mypackagehttps://company.jfrog.io/artifactory/api/npm/my-npm-registry/我怎样才能做到这一点?
.npmrc首先,您需要在本地.npmrc文件中配置您的访问权限。您可以将此文件放在源根文件夹中。
always-auth = true
# First, set a different registry URL for your scope
@myscope:registry=https://company.jfrog.io/artifactory/api/npm/my-npm-registry/
# Then, for this scope, you need to set the token
//company.jfrog.io/artifactory/api/npm/my-npm-registry/:_auth = {{your token - see below}}
Run Code Online (Sandbox Code Playgroud)
您需要从 Artifactory 获取 NPM 令牌(请注意,这不是您的 API 密钥。
curl -u {{ ARTIFACTORY_USERNAME }}:{{ ARTIFACTORY_API_KEY }} https://company.jfrog.io/artifactory/api/npm/auth/
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f {{ ARTIFACTORY_USERNAME }},{{ ARTIFACTORY_API_KEY }})))
Invoke-RestMethod -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} https://company.jfrog.io/artifactory/api/npm/auth/
Run Code Online (Sandbox Code Playgroud)
_auth = {{ YOUR_NPM_TOKEN }}
always-auth = true
Run Code Online (Sandbox Code Playgroud)
.npmrc上面的文件中。如何在 Github Actions 中完成这一切?
JFROG_USER&中JFROG_PAT。yarn/npm install:
always-auth = true
# First, set a different registry URL for your scope
@myscope:registry=https://company.jfrog.io/artifactory/api/npm/my-npm-registry/
# Then, for this scope, you need to set the token
//company.jfrog.io/artifactory/api/npm/my-npm-registry/:_auth = {{your token - see below}}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3518 次 |
| 最近记录: |