Gitea / Forgejo: Set commit status
Sets a commit status on a Gitea or Forgejo server: the check mark beside a commit and on its pull request.
- Kind:
gitea.set_commit_status - Palette: Integrations, under Gitea / Forgejo
- Credential: a credential of kind
bearer, named incredential - Other Gitea / Forgejo actions: Report a run’s status
When to use
Section titled “When to use”- A job decides for itself what to report on a self-hosted forge.
- Reporting from a run the automatic status reporting doesn’t cover, such as one a trigger step or a handler started.
A repo connected with spool repo connect … --status-credential <name> already reports its
builds. For a handler that reports each run’s lifecycle, use
report_run_status. Gitea also takes a warning state, which
GitHub doesn’t.
Connection (with)
Section titled “Connection (with)”| Field | Required | Description |
|---|---|---|
api_base |
yes | Include the /api/v1 suffix. Required, since a self-hosted forge has no default host. For example: https://gitea.example.com/api/v1. |
context |
no | The check’s name on the commit. Defaults to hyperspool. For example: hyperspool/ci. |
Input (input)
Section titled “Input (input)”| Field | Type | Required | Description |
|---|---|---|---|
repo |
string | yes | owner/name. |
sha |
string | yes | Full commit sha. |
state |
string | yes | What the check says about the commit. One of "pending", "success", "failure", "error", "warning". |
target_url |
string | no | Where the check links to. |
description |
string | no | One line shown beside the check. |
Settings
Section titled “Settings”Beside with and input in the node’s config.
| Field | Type | Required | Description |
|---|---|---|---|
credential |
string | yes | Name of the project credential the action authenticates with. |
fail_on_error_status |
boolean | no | Treat any 4xx/5xx as a failure. On by default: an action either did its job or did not. Default true. |
optional_when_untrusted |
boolean | no | Run without the credential when the run is untrusted (a fork pull request), instead of failing. The credential is still withheld. |
retry_on |
array | no | Status codes that fail the node instead of returning, so its retry: policy applies (e.g. [429, 503]). |
Output
Section titled “Output”The HTTP response. The reply is under body: nodes.<id>.output.body.<field>.
| Field | Type | Description |
|---|---|---|
status |
integer | The HTTP status code. |
headers |
object | The response headers. |
body |
object | The response body, parsed as JSON when it is JSON. |
body.context |
string | |
body.id |
integer | |
body.state |
string | |
body.target_url |
string | |
body.url |
string | The status on the API. |
How it runs
Section titled “How it runs”- On an agent with the
connectorcapability. The managed environments have one, so this needs no agent of your own. - One
POSTrequest to an address built fromwith. - Any 4xx or 5xx fails the step, unless
fail_on_error_statusisfalse.retry:asks again after a 5xx, a 401, 408, 409, 423, 425 or 429, or a 4xx withRetry-After, and not after any other 4xx, which would get the same answer.
Example
Section titled “Example”version: hyperspool-graph/v1nodes: - id: lint type: shell config: { run: make lint } continue_on_error: true - id: report type: gitea.set_commit_status config: credential: forge with: api_base: https://git.example.com/api/v1 context: hyperspool/lint input: repo: { $expr: "input.repo" } sha: { $expr: "input.sha" } state: { $expr: "nodes.lint.status == 'success' ? 'success' : 'warning'" }edges: - { from: lint, to: report }api_base is required and ends in /api/v1; there is no default host. The credential is an
access token that can write statuses: spool credential set forge --kind bearer.
See Connectors for credentials and versions, and the node reference for every other node.