agentleFS
Aidas-devAidas-dev/k8s-agent-skills/skills/gitea-webhooks/SKILL.md

gitea-webhooks

Skill4 starsChanged 5 months agoMITView on GitHub

Use when managing Gitea webhooks — creating webhooks via API, understanding event types, system vs repo vs org webhooks, payload verification with HMAC-SHA256, and supported webhook formats.

  • Sends data out
  • Commits and pushes

The file

Files
SKILL.md

Gitea Webhooks (v1.26)

Events

EventTrigger
pushGit push
create / deleteBranch/tag created or deleted
forkRepo forked
issuesIssue opened/closed/reopened/edited/deleted
issue_assignIssue assigned/unassigned
issue_labelIssue labels updated
issue_commentComment on issue
pull_requestPR opened/closed/reopened/edited/synced
pull_request_review_approvedPR approved
pull_request_review_rejectedPR rejected
pull_request_review_commentPR review comment
pull_request_review_requestReview requested
wikiWiki edited
repositoryRepo created/deleted
releaseRelease published/updated/deleted
packagePackage published
statusCommit status updated
workflow_runActions workflow run completed
workflow_jobActions workflow job ready (autoscaling trigger)

API

# Create repo webhook
curl -X POST https://git.example.com/api/v1/repos/{owner}/{repo}/hooks \
  -H "Authorization: token <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "gitea",
    "config": {
      "url": "https://example.com/webhook",
      "content_type": "json",
      "secret": "my-secret"
    },
    "events": ["push", "pull_request"],
    "active": true
  }'

# List webhooks
curl https://git.example.com/api/v1/repos/{owner}/{repo}/hooks \
  -H "Authorization: token <token>"

# Delete webhook
curl -X DELETE https://git.example.com/api/v1/repos/{owner}/{repo}/hooks/{id} \
  -H "Authorization: token <token>"

System vs Repo Webhooks

TypeScopeAPI Endpoint
RepositorySingle repoPOST /api/v1/repos/{owner}/{repo}/hooks
OrganizationAll repos in orgPOST /api/v1/orgs/{org}/hooks
SystemAll repos instance-widePOST /api/v1/admin/hooks (config.is_system_webhook: true)
DefaultTemplate for new reposPOST /api/v1/admin/hooks (config.is_system_webhook: false)

Payload Verification

Gitea signs the raw request body with HMAC-SHA256 using the configured secret.

Header: X-Gitea-Signature

Verify server-side:

import hmac, hashlib

signature = request.headers.get("X-Gitea-Signature")
expected = hmac.new(secret.encode(), request.body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(signature, expected):
    abort(401)

Webhook Types (format)

gitea (generic JSON), gogs, slack, discord, dingtalk, telegram, msteams, feishu, wechatwork, packagist.

Common Mistakes

  • HMAC algorithm — Gitea uses SHA256, not SHA1. Check X-Gitea-Signature header.
  • System webhook flag — Must set config.is_system_webhook to true for instance-wide webhooks. Defaults to false (template webhook).
  • Event names — Use snake_case in API: pull_request, issue_comment. Verify against docs.
  • workflow_job for autoscaling — Use workflow_job event (not workflow_run) to trigger ephemeral runner spin-up.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.