On this page
Gitea Branch
| source | condition | target |
|---|---|---|
✔ | ✔ | ✗ |
Description
The gitea/branch resource queries the branches of a repository hosted on Gitea, through the Gitea API rather than over the git protocol.
- source
Returns the branch matching
versionfilter(typically the highestrelease/x.y).- condition
Tests that
branchexists in the repository.- target
Not supported - a target fails with
target not supported for the plugin Gitea branch. Say so on the issue tracker if you would use one.
Note | An scm attached to a condition is ignored, with a warning. The lookup always goes to the Gitea API. |
Tip | To work with branches over the git protocol instead, on any host, use gitbranch. |
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| branch | string | [C] Branch specifies the branch name | |
| owner | string | [S][C] Owner specifies repository owner | |
| repository | string | [S][C] Repository specifies the name of a repository for a specific owner | |
| token | string | “token” specifies the credential used to authenticate with Gitea API 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 For more information, about a SOPS file, please refer to the following documentation: https://github.com/getsops/sops | |
| url | string | “url” defines the Gitea url to interact with | |
| username | string | “username” defines the username used to authenticate with Gitea API | |
| versionfilter | object | [S] VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest. | |
| kind | string | specifies the version kind such as semver, regex, or latest | |
| pattern | string | specifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format | |
| regex | string | specifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used. | |
| replaceall | object | replaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction. | |
| strict | boolean | strict enforce strict versioning rule. Only used for semantic versioning at this time |
owner and repository are mandatory. url points at your Gitea instance, e.g. try.gitea.io. There is no default.
branchCondition only - the branch being checked.
versionfilterSource only. See the "Version Filtering" page.
Authentication
token authenticates against the Gitea API. It is sensitive, so read it from the environment or a SOPS file rather than writing it into the manifest:
spec:
url: try.gitea.io
token: '{{ requiredEnv "GITEA_TOKEN" }}'
owner: updatecli
repository: updatecliReading a public repository works without any credential.
Example
# updatecli.yaml
name: "Test Gitea branch"
sources:
default:
kind: "gitea/branch"
spec:
url: "try.gitea.io"
owner: "olblak"
repository: "updatecli-test"
branch: main
conditions:
default:
name: Show condition usage without source input
kind: "gitea/branch"
disablesourceinput: true
spec:
url: "try.gitea.io"
owner: "olblak"
repository: "updatecli-test"
branch: "main"
sourcedefault:
name: Show condition using branch name fetch from source input
kind: "gitea/branch"
sourceid: "default"
spec:
url: "try.gitea.io"
owner: "olblak"
repository: "updatecli-test"
Links
The
giteascm - to clone and push