depentabot.yml中的环境变量?
我正在尝试设置 dependabot-standalone 在私人实例中。
这是一个NPM软件包,我正在使用私人NPM注册表来获取我的依赖关系。根据 docs ,我应该在<<<<中设置我的注册表访问数据代码> .gitlab/disterabot.yml 文件。
docs 用于 distrabot.yml
中的设置清楚地说明如何设置凭证以访问给定注册表:
registries:
npm-npmjs:
type: npm-registry
url: https://registry.npmjs.org
username: octocat
password: ${{secrets.MY_NPM_PASSWORD}} # Must be an unencoded password
registries:
npm-github:
type: npm-registry
url: https://npm.pkg.github.com
token: ${{secrets.MY_GITHUB_PERSONAL_TOKEN}}
但仅用于与project 秘密在Github中使用。 是否有一种方法可以使用GitLab的自定义定义的CI/CD变量?
到目前为止,我已经尝试使用 $ {{CI_PRIVATE_NPM_ACCESS_TOKEN}}} }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 npm-login-nononintractive 在这种情况下可能会有所帮助。
其他可能有用的答案,在这里:如何使用“ NPM登录”设置NPM凭据,而无需从stdin中阅读?
根据此,您需要在gitlab中设置以下环境变量:
settings_github_access_token
settings__gitlab_access_token
以在Gitlab中设置这些变量,以:gitlab to:project -&gt;&gt;设置 - &GT; CI/CD-&GT;变量。
I think npm-login-noninteractive could be helpful in this case.
Other possible useful answers, here: How to set npm credentials using `npm login` without reading from stdin?
According to this example, you need to set the following environment variables within GitLab:
SETTINGS__GITHUB_ACCESS_TOKEN
SETTINGS__GITLAB_ACCESS_TOKEN
To set these variables at the project level, within GitLab go to: Project -> Settings -> CI/CD -> Variables.