Xpersona
F

Forgejo Workflow

CLAWHUB · Unverified

Forgejo via fj and REST API for repos, issues, PRs, wiki, CI, and reviews.

62
Rank
84
Safety
991
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 991 downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171ecaaf30phe300z8gtb3dy584gt2d:forgejo-fj-api
  1. Install using `clawhub skill install s171ecaaf30phe300z8gtb3dy584gt2d:forgejo-fj-api` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/nerasse/forgejo-fj-api before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-nerasse-forgejo-fj-api/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

72,004 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: Forgejo Workflow
description: Forgejo via fj and REST API for repos, issues, PRs, wiki, CI, and reviews.
version: 0.1.1
homepage: https://github.com/nerasse/forgejo-skill
metadata:
  openclaw:
    emoji: "🦊"
    homepage: https://github.com/nerasse/forgejo-skill
    requires:
      bins:
        - fj
        - curl
        - jq
        - git
      env:
        - FORGEJO_URL
        - FORGEJO_TOKEN
    primaryEnv: FORGEJO_TOKEN
    install:
      - id: brew
        kind: brew
        formula: forgejo-cli
        bins:
          - fj
        label: Install Forgejo CLI (brew)
---

Use the `fj` CLI and the Forgejo REST API to interact with Forgejo repositories,
issues, pull requests, wiki pages, CI, and code review workflows.

## Overview

Use this skill when:
- Creating, listing, viewing, editing, or closing issues
- Creating, checking out, merging, or reviewing pull requests
- Managing repositories, forks, releases, labels, and milestones
- Reading or writing wiki pages
- Inspecting Forgejo Actions or CI status
- Performing a structured code review on a Forgejo pull request

Do not use this skill when:
- Working on local-only git operations such as commit, rebase, stash, push, or branch cleanup
- Working with GitHub or GitLab instead of Forgejo
- Performing Forgejo server administration that requires the `forgejo` server CLI

This skill targets one active Forgejo instance at a time.

Prefer `fj` for supported operations, use the REST API for feature gaps, and use
local `git` only for review and diff workflows.

## Prerequisites

Required binaries:
- `fj`
- `curl`
- `jq`
- `git`

Create an application token from:

    $FORGEJO_URL/user/settings/applications

Request only the scopes needed for the task. Common patterns for this skill are:
- `read:repository` or `write:repository` for repositories, pull requests, wiki, and releases
- `read:issue` or `write:issue` for issues, labels, and milestones
- `read:notification` or `write:notification` for notifications
- `read:organization` or `write:organization` for org labels and teams
- `read:user` or `write:user` only if user-level endpoints are needed

`FORGEJO_URL` must be the Forgejo base URL such as
`https://<your-forgejo-host>`, not an `/api/v1` endpoint.

`FORGEJO_URL` is the target Forgejo instance URL, not this skill repository URL.

## Required environment

| Variable | Required | Example | Purpose |
|---|---|---|---|
| `FORGEJO_URL` | Yes | `https://<your-forgejo-host>` | Base URL of the target Forgejo instance for this skill's REST and instance-selection workflow |
| `FORGEJO_TOKEN` | Yes | `forgejo_pat_...` | Application token used by this skill's REST examples and recommended for `fj` setup |

Authenticate `fj` with the same token when the target host is already inferable
from the current repository context:

    fj auth add-key <username>

If the current directory is not a Forgejo repository, or if you need to target a
different instance explicitly, pass the host:

    fj --host <

README.md

# Forgejo Workflow

OpenClaw skill for working with self-hosted Forgejo instances through `fj`, the
Forgejo REST API, and local `git` for review workflows. Published on ClawHub as
`forgejo-fj-api`.

## What this skill does

- Repositories, issues, pull requests, and releases
- Wiki reads through `fj` and wiki writes through the REST API
- Organization labels through `fj`; repository labels through the REST API by default, with `fj repo labels` available on current source builds but not packaged `0.4.x` releases; milestones through the REST API
- Forgejo Actions and CI status inspection
- Structured pull request review workflow

## Setup

Use one of these setup paths depending on whether you already have Forgejo
credentials.

### Manual setup

1. Install `fj`:

```bash
brew install forgejo-cli
```

2. Make sure the other required tools are available:

```bash
command -v curl jq git
```

3. Create an application token in Forgejo:

```text
https://<your-forgejo-host>/user/settings/applications
```

4. Export the required environment:

```bash
export FORGEJO_URL=https://<your-forgejo-host>
export FORGEJO_TOKEN=<your-token>
```

`FORGEJO_URL` must point to the target Forgejo instance, not to this skill
repository URL.

5. Add the same token to `fj` for the target host:

```bash
fj --host <your-forgejo-host> auth add-key <username>
```

6. Verify readiness:

```bash
command -v fj curl jq git
test -n "$FORGEJO_URL" && test -n "$FORGEJO_TOKEN"
fj auth list
```

### Prompt-guided setup

The assistant can guide setup, verify what is missing, and give exact commands.
It cannot create the Forgejo token for you; token creation still happens in the
Forgejo web UI.

If you already have credentials:

```text
Set up this Forgejo skill for https://<your-forgejo-host>. I already have a token and my Forgejo username is alice. First check whether fj, curl, jq, and git are available. If one of them is missing and OpenClaw can install it, install it. Then assume FORGEJO_URL and FORGEJO_TOKEN may already be available either from the OpenClaw .env loaded for this session or from exported shell variables, verify whether they are present, tell me the exact fj --host <your-forgejo-host> auth add-key alice command to run if fj auth is not ready yet, and finally tell me clearly whether the skill is fully ready, partially ready, or blocked, and what is still missing if anything.
```


## Configuration model

This skill targets one active Forgejo instance at a time.

Required environment:

| Variable | Required | Example | Purpose |
|---|---|---|---|
| `FORGEJO_URL` | Yes | `https://<your-forgejo-host>` | Base URL of the Forgejo instance for this skill's REST and instance-selection workflow |
| `FORGEJO_TOKEN` | Yes | `forgejo_pat_...` | Application token for this skill's REST examples and recommended `fj` setup |

Repository targeting:
- Resolve the repository from the current git remote when possible
- Outside a local clone, pass an explicit repo target and ensure `fj` can al

_meta.json

{
  "ownerId": "kn79y8m1z6hhpqqfph4vzjz1mx84hp1a",
  "slug": "forgejo-fj-api",
  "version": "0.1.1",
  "publishedAt": 1775762136982
}

references/api-cheatsheet.md

# Forgejo API Cheatsheet

This reference assumes `FORGEJO_URL` and `FORGEJO_TOKEN` are already set.

If required bins, env vars, or `fj` setup are missing, return to `SKILL.md`
prerequisites, readiness checks, or troubleshooting before proceeding.

Use these endpoints when `fj` does not support the requested operation.

The examples in this skill use these JSON request headers:

```bash
-H "Authorization: token $FORGEJO_TOKEN"
-H "Content-Type: application/json"
-H "Accept: application/json"
```

Forgejo also accepts bearer-style authorization headers. The examples in this
skill use the `Authorization: token ...` form for consistency.

## Wiki writes

Create a page:

```http
POST /repos/{owner}/{repo}/wiki/new
```

Request body:

```json
{
  "title": "Page Title",
  "content_base64": "<base64>",
  "message": "Create wiki page"
}
```

Update a page:

```http
PATCH /repos/{owner}/{repo}/wiki/page/{pageName}
```

Request body:

```json
{
  "title": "Page Title",
  "content_base64": "<base64>",
  "message": "Update wiki page"
}
```

If `title` is omitted or empty on update, the current page name is kept.

Delete a page:

```http
DELETE /repos/{owner}/{repo}/wiki/page/{pageName}
```

List or read pages:

```http
GET /repos/{owner}/{repo}/wiki/pages
GET /repos/{owner}/{repo}/wiki/page/{pageName}
GET /repos/{owner}/{repo}/wiki/revisions/{pageName}
```

Encode wiki content to base64 before sending it:

```bash
printf '%s' "# My Page
Page content here" | base64
```

The wiki create and edit request body uses the `CreateWikiPageOptions` schema in
Swagger. Confirm field names against the target instance's `/api/swagger` if you
need to script it precisely for a specific Forgejo version.

## Repository labels

List labels:

```http
GET /repos/{owner}/{repo}/labels
```

Create a label:

```http
POST /repos/{owner}/{repo}/labels
```

```json
{
  "name": "bug",
  "color": "#d73a4a",
  "description": "Bug report",
  "exclusive": false,
  "is_archived": false
}
```

Update a label:

```http
PATCH /repos/{owner}/{repo}/labels/{id}
```

Delete a label:

```http
DELETE /repos/{owner}/{repo}/labels/{id}
```

## Milestones

List milestones:

```http
GET /repos/{owner}/{repo}/milestones
GET /repos/{owner}/{repo}/milestones/{id}
```

Create a milestone:

```http
POST /repos/{owner}/{repo}/milestones
```

```json
{
  "title": "v2.0",
  "description": "Release milestone",
  "due_on": "2026-06-01T00:00:00Z",
  "state": "open"
}
```

Update a milestone:

```http
PATCH /repos/{owner}/{repo}/milestones/{id}
```

Delete a milestone:

```http
DELETE /repos/{owner}/{repo}/milestones/{id}
```

## Pull request reviews with inline comments

Create a review with summary and inline comments:

```http
POST /repos/{owner}/{repo}/pulls/{index}/reviews
```

```json
{
  "body": "Review summary",
  "event": "COMMENT",
  "comments": [
    {
      "path": "src/main.go",
      "new_position": 42,
      "body": "Potential nil pointer here"
    }
  ]
}
```

The Swagger schema also defines `old_p

references/ci-actions.md

# Forgejo CI and Actions

This reference assumes `FORGEJO_URL` and `FORGEJO_TOKEN` are already set.

If required bins, env vars, or `fj` setup are missing, return to `SKILL.md`
prerequisites, readiness checks, or troubleshooting before proceeding.

Use this reference when `fj` is not enough for CI or Forgejo Actions tasks.

## Fast path with `fj`

Use `fj` first for quick checks:

```bash
fj --repo owner/repo actions tasks
fj pr status 55
```

Use this when the user mainly needs recent runs or a simple status
summary.

## REST API coverage

Forgejo API coverage for Actions varies by Forgejo version. Check the target
instance at:

```text
https://<your-forgejo-host>/api/swagger
```

Current Forgejo source exposes these Actions endpoints:

```http
GET /repos/{owner}/{repo}/actions/tasks
GET /repos/{owner}/{repo}/actions/runs
GET /repos/{owner}/{repo}/actions/runs/{run_id}
GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs
POST /repos/{owner}/{repo}/actions/workflows/{workflowfilename}/dispatches
```

`GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs` is present in current
source, but was not found in any checked published tags. Treat it as unreleased
or branch-only unless the target instance Swagger documents it explicitly.

Job-log coverage is also version-sensitive. Checked Forgejo source exposes job-log
paths as web routes rather than stable REST API endpoints, and the URL shape has
changed across versions.

Workflow dispatch requires a `ref`. Current server implementations also support
optional `inputs`, and `return_run_info=true` can switch the response from `204`
to a created-run payload.

## Checking CI for a pull request

1. Get the pull request metadata and head SHA.

```bash
curl -sS \
  -H "Authorization: token $FORGEJO_TOKEN" \
  -H "Accept: application/json" \
  "$FORGEJO_URL/api/v1/repos/$OWNER/$REPO/pulls/55" | jq -r '.head.sha'
```

2. Fetch commit statuses.

```bash
curl -sS \
  -H "Authorization: token $FORGEJO_TOKEN" \
  -H "Accept: application/json" \
  "$FORGEJO_URL/api/v1/repos/$OWNER/$REPO/statuses/$SHA" | jq '.[] | {context, status, target_url}'
```

Related status endpoints also exist under:

```http
GET /repos/{owner}/{repo}/commits/{ref}/statuses
GET /repos/{owner}/{repo}/commits/{ref}/status
```

3. If needed, inspect workflow runs through the Actions endpoints.
4. Only use the run-jobs endpoint when the target instance Swagger documents it.

## Reading job logs

If the target instance exposes job and log endpoints in Swagger, use them.
Otherwise say the instance does not document those endpoints and fall back to the
best available run or status summary rather than inventing details.

## `fj-ex` as a last resort

`fj-ex` is a community extension that fills some gaps such as detailed logs,
artifacts, cancel, rerun, and workflow dispatch by scraping the web UI.

Use it only as an optional fallback, not as a required dependency.

Important constraints:
- It is not part of the core required toolchain
- It may break whe

Sponsored

Ads related to Forgejo Workflow and adjacent AI workflows.