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 | “branch” defines the name of the branch to check. compatible:
default: the output of the associated source. example:
| |
| owner | string | “owner” defines the owner of the Gitea repository. compatible:
example:
| |
| repository | string | “repository” defines the name of the Gitea repository for a specific owner. compatible:
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:
| |
| versionfilter | object | “versionfilter” defines the version pattern and kind used to select a branch. compatible:
default: kind: latest remark:
example:
| |
| kind | string | “kind” defines the versioning scheme used to select a version. default: latest remark:
example:
| |
| pattern | string | “pattern” defines the version pattern, according to “kind”. default:
remark:
example:
| |
| regex | string | “regex” defines the regular expression extracting the version from each entry. remark:
example:
| |
| replaceall | object | “replaceall” applies a regular expression replacement to each version before filtering. remark:
example: turns “curl-8_15_0” into “curl-8.15.0”. | |
| strict | boolean | “strict” enforces strict semantic versioning rules when parsing versions. default: false remark:
|
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