Gitee
The Gitee provider covers gitee.com through the Gitee Open API v5. It reads and writes issues and pull requests. It also covers notifications, releases, repository contents, check runs and repository webhooks. The provider doesn't cover the enterprise edition (e.gitee.com).
| Detail | Value |
|---|---|
| Import | forges/gitee |
| Factories | gitee(), giteeLite() |
| Auth | token, anonymous |
'experimental'. See Capabilities.Authentication
The provider accepts a personal access token or an OAuth access token. It sends the token in an Authorization: token <token> header, so the token doesn't appear in URLs:
import { gitee } from 'forges/gitee'
const forge = gitee({
auth: { type: 'token', token: process.env.GITEE_TOKEN! },
}).create()
Without auth, the provider makes anonymous public reads.
Instance
The instance is gitee.com. baseUrl defaults to https://gitee.com, and the provider appends /api/v5.
Issue numbers and states
Issue numbers are alphanumeric, such as I8ABCD. Pull request numbers are integers.
A Gitee issue is open, progressing, closed or rejected. The provider maps these states as follows:
progressingissues are open, so a listing of open issues includes them.rejectedissues are closed, withstateReason: 'not_planned'.
Assignees and reviewers
On Gitee, the reviewers of a pull request are stored as its assignees. The provider reports them in thread.reviewers, and requestReview() sets them. An issue has a single assignee, so assigning more than one user rejects.
Merging
Gitee doesn't report which merge methods a repository allows, so merge() requires method. Without it, the call throws MergeMethodRequiredError. whenChecksPass is unavailable.
Reviews
Gitee records an approval, but it has no endpoint to read reviews. threads.reviews() is unavailable, and createReview() accepts the approve event only.
Latest release
The release that Gitee marks as latest can be a prerelease. releases.latest() returns the newest release that isn't a prerelease.
Search
search.threads() searches issues only. A search with kind: 'pull_request' returns an empty page with a kind_unsupported warning.
Webhooks
Set webhookSecret to the hook's password or signing secret:
const forge = gitee({
webhookSecret: process.env.GITEE_WEBHOOK_SECRET,
}).create()
const events = await forge.webhooks.ingest({
headers: request.headers,
body: await request.text(),
})
Gitee sends the password or the signature in X-Gitee-Token, and the provider accepts either one:
- In password mode,
X-Gitee-Tokencontains the password. - In signing mode,
X-Gitee-Tokencontains the URL-encoded base64 HMAC-SHA256 of<X-Gitee-Timestamp>\n<secret>. The signature covers the timestamp but not the body. The provider rejects timestamps more than one hour from the current time.
Webhook management works on repositories only. Gitee has no delivery log, so webhooks.deliveries() and webhooks.redeliver() are unavailable.
Recording fixtures
GITEE_TOKEN=... FIXTURE_GITEE_REPO=owner/repo FIXTURE_GITEE_PULL=1 \
pnpm record-fixtures gitee
To add an issue, set FIXTURE_GITEE_ISSUE.
Capabilities
Generated by pnpm capability-matrix; do not edit by hand.
| Capability | Support |
|---|---|
experimental | ✅ |
sources.poll | ✅ |
sources.webhook | ✅ |
sources.subscribe | ❌ |
repos.get | ✅ |
users.get | experimental |
repos.list | experimental |
repos.labels | experimental |
repos.createLabel | experimental |
repos.milestones | ❌ |
repos.collaborators | experimental |
repos.permissionFor | ❌ |
repos.addCollaborator | ❌ |
repos.assignableUsers | ❌ |
repos.reviewerCandidates | ❌ |
threads.get | issue (experimental), PR |
threads.list | issue (experimental), PR |
threads.getMany | ✅ |
comments.list | issue (experimental), PR |
comments.edit | issue (experimental), PR (experimental) |
comments.delete | issue (experimental), PR (experimental) |
reactions.list | ❌ |
notifications.list | ✅ |
notifications.markRead | ✅ |
notifications.markDone | ❌ |
notifications.unsubscribe | ❌ |
notifications.markAllRead | experimental |
notifications.markAllDone | ❌ |
notifications.unreadCount | experimental |
writes.comment | issue (experimental), PR |
writes.upsertComment | issue (emulated), PR (emulated) |
writes.close | issue, 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 | ❌ |
writes.react | ❌ |
writes.setAssignees | issue (experimental) |
writes.requestReview | PR (experimental) |
writes.merge | ✅ |
writes.approveAndMerge | ✅ |
writes.transfer | ❌ |
writes.markDuplicate | ❌ |
subscriptions.get | ❌ |
subscriptions.set | ❌ |
installations | ❌ |
checks.thread | PR |
checks.list | experimental |
checks.report | ❌ |
checks.rerun | ❌ |
ci.runs | ❌ |
ci.run | ❌ |
ci.jobs | ❌ |
ci.log | ❌ |
contents.file | experimental |
contents.tree | experimental |
contents.branches | experimental |
contents.tags | experimental |
contents.resolveRef | experimental |
contents.commits | experimental |
contents.commit | experimental |
contents.compare | experimental |
contents.threadFiles | experimental |
contents.threadCommits | experimental |
reviews.list | ❌ |
reviews.create | emulated |
reviews.submit | ❌ |
reviews.approve | emulated |
reviews.resolveThread | ❌ |
releases.list | ✅ |
releases.get | ✅ |
releases.latest | ✅ |
releases.getByTag | experimental |
releases.downloadAsset | ❌ |
webhooks.list | experimental |
webhooks.create | experimental |
webhooks.update | experimental |
webhooks.delete | experimental |
webhooks.rotateSecret | experimental |
webhooks.deliveries | ❌ |
webhooks.redeliver | ❌ |
search.threads | experimental |
search.repos | experimental |
search.commits | ❌ |
securityAlerts | ❌ |
eventKinds | native |
auth | token, anonymous |
limits | unknown |