Gitlab Merge Request
kind: gitlab/mergerequest
On this page
Description
The action
section describes the Gitlab Merge Requests that updatecli is expected to open (or update) when a target is modified.
Parameters
Name | Type | Description | Required |
---|---|---|---|
body | string | “body” defines a custom mergerequest body
| |
owner | string | “owner” defines the GitLab repository owner.
| |
repository | string | “repository” defines the GitLab repository for a specific owner
| |
sourcebranch | string | “sourcebranch” defines the branch name used as a source to create the GitLab mergerequest.
| |
targetbranch | string | “targetbranch” defines the branch name used as a target to create the GitLab mergerequest.
| |
title | string | “title” defines the GitLab mergerequest title
| |
token | string | “token” defines the credential used to authenticate with GitLab remark: A token is a sensitive information, it’s recommended to not set this value directly in the configuration file but to use an environment variable or a SOPS file. The value can be set to
https://github.com/getsops/sops | |
url | string | “url” defines the GitLab url to interact with default: “gitlab.com” | |
username | string | “username” defines the username used to authenticate with GitLab |
Example
# updatecli.yaml
# updatecli diff --config updatecli.yaml
#
name: Show Gitlab pipeline example
# Sources are responsible to fetch information from third location such as npm registry.
sources:
updatecli:
name: Get latest axios version
kind: npm
spec:
name: axios
# Targets are responsible to update targeted files such as a yaml file.
targets:
npm:
name: Update e2e test file
kind: yaml
sourceid: updatecli
scmid: gitlab
spec:
file: e2e/updatecli.d/success.d/npm.yaml
key: conditions.axios.spec.version
###
# Actions such as gitlab/mergerequest is triggered if a target is updated.
actions:
default:
title: Bump axios version
kind: gitlab/mergerequest
scmid: gitlab
scms:
gitlab:
kind: gitlab
spec:
owner: "olblak"
repository: "updatecli"
branch: main
# For the change to be apply, we need to specify gitlab credentials
#username: gitlab_username
#token: gitlab_token