Skip to content

Commit

Permalink
Update gitlab token docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cliedeman committed Jan 14, 2024
1 parent 1d1e036 commit 96ea283
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,20 @@ jobs:

### Example GitLab CI Config

#### GitLab token
It is necessary to create a new Gitlab personal access token with the `api` scope [here](https://gitlab.com/profile/personal_access_tokens).
#### Job Token
If you do not provide a PAT the [job token](https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html) will be used.
This restricted token can create releases but not read commits. There the [git strategy](https://docs.gitlab.com/ee/ci/runners/configure_runners.html#git-strategy) must be set to clone so that we can read the commits from the repository.

#### Personal Access Token
Create a new Gitlab personal access token with the `api` scope [here](https://gitlab.com/profile/personal_access_tokens).
Ensure the CI variable is protected and masked as the `GITLAB_TOKEN` has a lot of rights. There is an open issue for project specific [tokens](https://gitlab.com/gitlab-org/gitlab/issues/756)
You can set the GitLab token via the `GITLAB_TOKEN` environment variable or the `-token` flag.

.gitlab-ci.yml
```yml
variables:
# Only needs if using job token
GIT_STRATEGY: clone
stages:
# other stages
- release
Expand Down

0 comments on commit 96ea283

Please sign in to comment.