Gitea
The Gitea provider covers gitea.com and self-hosted Gitea instances. It uses the same implementation as the Forgejo provider, so the Forgejo page applies here, apart from the default instance and the webhook headers. Refs from this provider have forge: 'gitea'.
| Detail | Value |
|---|---|
| Import | forges/gitea |
| Factories | gitea(), giteaLite() |
| Auth | token, anonymous |
Authentication
The provider accepts an access token:
import { gitea } from 'forges/gitea'
const forge = gitea({
auth: { type: 'token', token: process.env.GITEA_TOKEN! },
}).create()
Without auth, the provider makes anonymous public reads.
Instance
The default instance is https://gitea.com. For a self-hosted instance, set baseUrl to the root of the instance. The provider appends /api/v1:
gitea({ baseUrl: 'https://gitea.example.com', auth })
refreshCapabilities() reads the instance version from /version.
Behaviour shared with Forgejo
These sections of the Forgejo page apply to Gitea:
Webhooks
Set webhookSecret to the secret configured on the hook:
const forge = gitea({
webhookSecret: process.env.GITEA_WEBHOOK_SECRET,
}).create()
const events = await forge.webhooks.ingest({
headers: request.headers,
body: await request.text(),
})
Gitea sends these headers with each delivery:
| Header | Content |
|---|---|
X-Gitea-Signature | The hex HMAC-SHA256 of the body |
X-Gitea-Event | The event name |
X-Gitea-Delivery | The delivery ID |
The Gitea provider doesn't read X-Forgejo-* headers.
A label delivery doesn't say which labels were added or removed. A changed label set becomes a label event with the edited action, and removing every label becomes one with the unlabelled action.
Recording fixtures
GITEA_TOKEN=... FIXTURE_GITEA_REPO=owner/repo FIXTURE_GITEA_PULL=1 \
pnpm record-fixtures gitea
To add an issue, set FIXTURE_GITEA_ISSUE. To record a self-hosted instance, set GITEA_BASE_URL.
Capabilities
Generated by pnpm capability-matrix; do not edit by hand.
| Capability | Support |
|---|---|
experimental | ❌ |
sources.poll | ✅ |
sources.webhook | ✅ |
sources.subscribe | ❌ |
repos.get | ✅ |
users.get | ✅ |
repos.list | ✅ |
repos.labels | ✅ |
repos.createLabel | experimental |
repos.milestones | ✅ |
repos.collaborators | ✅ |
repos.permissionFor | experimental |
repos.addCollaborator | experimental |
repos.assignableUsers | ✅ |
repos.reviewerCandidates | experimental |
threads.get | issue, PR, commit (experimental) |
threads.list | issue, PR |
threads.getMany | ✅ |
comments.list | issue, PR |
comments.edit | issue (experimental), PR (experimental) |
comments.delete | issue (experimental), PR (experimental) |
reactions.list | issue, PR |
notifications.list | ✅ |
notifications.markRead | ✅ |
notifications.markDone | emulated |
notifications.unsubscribe | ✅ |
notifications.markAllRead | ✅ |
notifications.markAllDone | ❌ |
notifications.unreadCount | ✅ |
writes.comment | issue (experimental), PR |
writes.upsertComment | issue (emulated), PR (emulated) |
writes.close | issue (experimental), PR |
writes.reopen | issue (experimental), PR |
writes.create | issue (experimental), PR (experimental) |
writes.update | issue (experimental), PR (experimental) |
writes.setLabels | issue (experimental), PR (experimental) |
writes.addLabels | issue (experimental), PR (experimental) |
writes.removeLabels | issue (experimental), PR (experimental) |
writes.setMilestone | issue (experimental), PR (experimental) |
writes.react | issue (experimental), PR (experimental) |
writes.setAssignees | issue (experimental), PR (experimental) |
writes.requestReview | PR (experimental) |
writes.merge | ✅ |
writes.approveAndMerge | ✅ |
writes.transfer | ❌ |
writes.markDuplicate | ❌ |
subscriptions.get | issue, PR |
subscriptions.set | issue, PR |
installations | ❌ |
checks.thread | PR |
checks.list | ✅ |
checks.report | experimental |
checks.rerun | ❌ |
ci.runs | ❌ |
ci.run | ❌ |
ci.jobs | ❌ |
ci.log | ❌ |
contents.file | ✅ |
contents.tree | ✅ |
contents.branches | ✅ |
contents.tags | ✅ |
contents.resolveRef | ✅ |
contents.commits | ✅ |
contents.commit | ✅ |
contents.compare | ✅ |
contents.threadFiles | ✅ |
contents.threadCommits | ✅ |
reviews.list | ✅ |
reviews.create | experimental |
reviews.submit | experimental |
reviews.approve | experimental |
reviews.resolveThread | ❌ |
releases.list | ✅ |
releases.get | ✅ |
releases.latest | ✅ |
releases.getByTag | ✅ |
releases.downloadAsset | experimental |
webhooks.list | experimental |
webhooks.create | experimental |
webhooks.update | experimental |
webhooks.delete | experimental |
webhooks.rotateSecret | experimental |
webhooks.deliveries | ❌ |
webhooks.redeliver | ❌ |
search.threads | ✅ |
search.repos | ✅ |
search.commits | ❌ |
securityAlerts | ❌ |
eventKinds | native |
auth | token, anonymous |
limits | unknown |