Skip to content
Snippets Groups Projects
Commit b11b1695 authored by dannylongeuay's avatar dannylongeuay Committed by Christoph Witzko
Browse files

docs(README): :pencil: add section on using ci_job_token

parent 96a103ba
No related branches found
No related tags found
No related merge requests found
...@@ -119,6 +119,34 @@ release: ...@@ -119,6 +119,34 @@ release:
- semantic-release # Add --allow-no-changes if you want to create a release for each push - semantic-release # Add --allow-no-changes if you want to create a release for each push
``` ```
#### 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
.gitlab-ci.yml
```yml
variables:
GIT_STRATEGY: clone
stages:
# other stages
- release
release:
image:
name: registry.gitlab.com/go-semantic-release/semantic-release:latest
entrypoint: [""]
stage: release
# when: manual # Add this if you want to manually create releases
only:
- master
script:
- semantic-release
# - semantic-release --allow-no-changes # create a release for each push
# - semantic-release --provider gitlab --provider-opt log_order=ctime # traverse commits by committer time (commits in merge requests will affect the calculated version)
```
### Releasing a Go application with GitLab CI ### Releasing a Go application with GitLab CI
The full example can be found at https://gitlab.com/go-semantic-release/example-go-application. The full example can be found at https://gitlab.com/go-semantic-release/example-go-application.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment