Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gitlab token docs #170

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. 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. See example below

#### Personal Access Token
Create a new Gitlab personal access token with the `api` scope [here](https://gitlab.com/profile/personal_access_tokens).
christophwitzko marked this conversation as resolved.
Show resolved Hide resolved
christophwitzko marked this conversation as resolved.
Show resolved Hide resolved
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
Loading