Trunk-based workflow component
Usage
- Ensure your projects have a description
- Set
GITLAB_TOKENas a masked, protected and hidden variable for your group - Protect your
mainbranch - Create GitLab pipeline file
.gitlab-ci.yml:
Branching
Roles
The following roles exist in the scenarios:
- Developer
- Creates a short-lived feature, fix, chore, or hot fix branch
- Implements the change and keeps it small enough to merge quickly
- Creates a merge request to the default branch after successful local testing
- Maintainer
- Reviews merge requests
- Merges into the default branch after the pipeline succeeds and discussions are resolved
Settings enabled by default
- Protect Branch main
- Disable force pushes on main
- Branch rules
- fast forward merge
- Pipelines must succeed before merge
- Skipped pipelines are considered successful
- All discussions must be resolved
- Prevent approval by merge request author
- Merge request branch workflow:
-
- feat/* -> main
-
- fix/* -> main
-
- chore/* -> main
-
- hotfix/* -> main
Inputs
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| autoconfigure-enabled | Enable or disable the automatic configuration of the pipeline. | true | boolean |
| rules | The rules that control when the project configuration job runs. | [{"if":"$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH","when":"always"},{"when":"never"}] | array |