diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 12:06:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 12:06:30 +0300 |
commit | e24153b0cb080b1b25076f8fd358b4273848f2e2 (patch) | |
tree | b3fc6d552241905fa927db14f8920c4809e74a6f /doc/user/packages/npm_registry/index.md | |
parent | 3fe34368770022c88fd89c8df58b39bf0789e646 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/packages/npm_registry/index.md')
-rw-r--r-- | doc/user/packages/npm_registry/index.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/user/packages/npm_registry/index.md b/doc/user/packages/npm_registry/index.md index 357b7a30591..d8b59ae63d0 100644 --- a/doc/user/packages/npm_registry/index.md +++ b/doc/user/packages/npm_registry/index.md @@ -108,6 +108,21 @@ Then, you could run `npm publish` either locally or via GitLab CI/CD: - **GitLab CI/CD:** Set an `NPM_TOKEN` [variable](../../../ci/variables/README.md) under your project's **Settings > CI/CD > Variables**. + +### Authenticating with a CI job token + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9104) in GitLab Premium 12.5. + +If you’re using NPM with GitLab CI/CD, a CI job token can be used instead of a personal access token. +The token will inherit the permissions of the user that generates the pipeline. + +Add a corresponding section to your `.npmrc` file: + +```ini +@foo:registry=https://gitlab.com/api/v4/packages/npm/ +//gitlab.com/api/v4/packages/npm/:_authToken=${env.CI_JOB_TOKEN} +//gitlab.com/api/v4/projects/{env.CI_PROJECT_ID>/packages/npm/:_authToken=${env.CI_JOB_TOKEN} +``` ## Uploading packages |