Gitea Pull Request
Description
The gitea/pullrequest action opens (or updates) a Gitea pull request once a target linked to the same scm has changed something and the change has been pushed.
It is the second half of the Gitea workflow: the gitea scm commits to a working branch and pushes it, this action turns that branch into a pull request. Without it, the branch is pushed and nothing else happens.
Note | kind: gitea is a deprecated alias for kind: gitea/pullrequest. It still works and logs a warning. |
Requirements
An action never runs on its own: it needs an scmid pointing at an scm declared in the same manifest, and that scm must be of the matching kind. Both are checked when the manifest loads:
missing value for parameter(s) ["scmid"]
scm of kind "git" is not compatible with action of kind "github/pullrequest"The action then reuses that scm rather than being configured twice. From it, it inherits:
| Field | Inherited value |
|---|---|
| The working branch the scm created and pushed - the branch carrying the changes. |
| The scm’s |
| The repository the scm points at. |
credentials, URL | Whatever the scm was given, when the action does not set its own. |
Every one of these can be overridden in the action spec, but there is rarely a good reason to: a mismatch between the branch the scm pushed and the branch the action opens the request from produces a request with no changes in it.
Where the title comes from
The title is resolved from the first of these that is set:
spec.titleon the actiontitleon the action itself, one level abovespecthe name of the associated target, when there is exactly one
the pipeline name
The second form is the usual one:
actions:
default:
kind: <the action kind>
scmid: default
title: 'deps: bump axios version'Create or update
Updatecli looks for a request already open between the same two branches before creating one, so running the same pipeline repeatedly gives you one long-lived request per pipeline and repository rather than one per run. Whether that existing request is then refreshed with the latest title and description differs by plugin (each page says which).
Creation is also skipped, without failing the pipeline, when either branch is missing from the remote. Updatecli attempts it on every run regardless, so that a request closed by hand or lost to an earlier failure gets reopened on the next one.
Pipeline URL
When Updatecli detects that it runs inside a CI job, it appends a link to that job in the request description. Set disablepipelineurl: true on the action (next to kind and scmid, not inside spec) to leave it out.
Detection is limited to three engines, each recognised by one environment variable: Jenkins (JENKINS_URL), GitLab CI (GITLAB_CI), and GitHub Actions (GITHUB_ACTION), checked in that order. Anywhere else no link is added, whatever this setting says.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| assignees | array | “assignees” defines the list of users assigned to the pull request. default: no assignee. remark:
example: | |
| body | string | “body” defines a custom body for the pull request. default: a body generated from the pipeline execution. remark:
| |
| owner | string | “owner” defines the owner of the Gitea repository. default: the owner of the scm, when the action uses a scm of kind “gitea”. remark:
| |
| repository | string | “repository” defines the name of the Gitea repository for a specific owner. default: the repository of the scm, when the action uses a scm of kind “gitea”. remark:
| |
| sourcebranch | string | “sourcebranch” defines the branch name used as the source of the Gitea pull request. default: the working branch of the scm, when the action uses a scm of kind “gitea”. remark:
| |
| targetbranch | string | “targetbranch” defines the branch name used as the target of the Gitea pull request. default: the branch of the scm, when the action uses a scm of kind “gitea”. remark:
| |
| title | string | “title” defines the title of the Gitea pull request. default: the first match from the following list:
remark:
example: | |
| token | string | “token” defines the credential used to authenticate with the Gitea API. remark:
| |
| url | string | “url” defines the Gitea url to interact with. remark:
example:
| |
| username | string | “username” defines the username used to authenticate with the Gitea API. remark:
|
The spec is small - title, body, and assignees, on top of the identity fields inherited from the scm. Labels, reviewers, and merge automation are not exposed by this plugin.
bodyReplaces the description Updatecli generates from the pipeline run. Useful to add context a reviewer needs, such as a changelog URL.
assigneesGitea usernames, who must have access to the repository. They are set when the pull request is created and not reapplied afterwards.
Updating an existing pull request
When a pull request is already open between the two branches, this plugin leaves it untouched - it does not refresh the title or the description with the latest run, unlike the GitHub, GitLab, Bitbucket Cloud, and Azure DevOps plugins. The report still links to it.
Warning | If the API call creating the pull request fails, for any reason, Updatecli logs |
Warning | The |
Cleanup
Cleanup is not implemented for this plugin. updatecli apply --clean-git-branches removes working branches that ended up with no changes, but a pull request already opened for one of them is not closed automatically (that stays a manual step).
The same goes for the options this plugin does not expose, such as labels and reviewers. If closing stale pull requests, or anything else missing here, is something you would use, say so on the Updatecli issue tracker (these gaps are unimplemented rather than deliberate, and interest is what gets them prioritised).
Example
# updatecli.yaml
# updatecli.yaml
# updatecli diff --config updatecli.yaml
#
name: Show Gitea pipeline example
scms:
gitea:
kind: gitea
spec:
url: "demo.gitea.com"
owner: "olblak"
repository: "updatecli-mirror"
branch: main
# 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: gitea
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:
kind: gitea/pullrequest
scmid: gitea
title: Bump axios version