giteabot is a Go-based helper bot for Gitea and GitHub repositories. It is a drop-in replacement for the GiteaBot backporter workflow and can run as a GitHub Action, a Gitea Action, or a standalone webhook service.
giteabot fetches the current Gitea development versions from milestones. It looks for merged PRs
with the label backport/v{gitea_version} but without backport/done or backport/manual.
It will cherry-pick the merge commit onto the release branch, push to your fork, and open a new
backport pull request with labels copied from the original PR.
giteabot removes reviewed/wait-merge, reviewed/prioritize-merge, and pr/last-call from merged
pull requests. It also removes backport/* labels from pull requests that already target release
branches. If a PR description contains ## :warning: BREAKING, it adds the pr/breaking label.
giteabot looks for PRs with reviewed/wait-merge and updates their branches. If a merge conflict
is detected during the update, the PR is removed from the merge queue.
When a pull request is created, giteabot assigns a milestone based on the target branch. For PRs
targeting main, the latest release milestone is used. It also removes milestones from closed,
unmerged pull requests.
giteabot tracks approvals and updates the lgtm/* labels (need 2, need 1, done, or blocked)
plus a commit status context giteabot/lgtm indicating whether the PR is ready.
If a PR changes non-English translation files under options/locale/, giteabot comments to direct
contributors to Crowdin and asks them to revert the changes.
giteabot locks issues and pull requests that have been closed for 3 months. If there was discussion within the last two weeks, it posts a follow-up comment asking to open a new issue.
Issues labeled issue/needs-feedback are closed if no activity occurs for a month.
Maintainers can apply giteabot/update-branch to request an update of the PR branch.
PRs labeled pr/last-call are closed after two weeks of inactivity. After one week, giteabot
notifies the technical oversight committee if only one approval is missing.
giteabot reads settings from environment variables (Action inputs map to these values).
Required:
GITEABOT_TOKEN: API token for GitHub or Gitea.
Optional in Actions (auto-detected), required elsewhere:
GITEABOT_REPO: target repository inowner/nameformat (auto-detected fromGITHUB_REPOSITORYorGITEA_REPOSITORYwhen running in Actions).
Optional:
GITEABOT_FORK: fork repository for backport branches (required for backport creation).GITEABOT_PROVIDER:githuborgitea(auto-detected when possible).GITEABOT_API_BASE: GitHub API base (https://api.github.com) or Gitea API base (https://gitea.com/api/v1).GITEABOT_MODE:event(default),maintenance, orserver.GITEABOT_EVENT_PATH: event JSON path ineventmode.GITEABOT_EVENT_NAME: event name string ineventmode.GITEABOT_WEBHOOK_SECRET: webhook secret used inservermode.GITEABOT_LISTEN: listen address forservermode (default:8000).GITEABOT_TRIGGER_PATH: webhook path forservermode (default/trigger).
Feature toggles (default true):
GITEABOT_FEATURE_BACKPORTGITEABOT_FEATURE_LABEL_MAINTENANCEGITEABOT_FEATURE_MERGE_QUEUEGITEABOT_FEATURE_MILESTONESGITEABOT_FEATURE_LGTMGITEABOT_FEATURE_COMMENTSGITEABOT_FEATURE_LOCKINGGITEABOT_FEATURE_FEEDBACKGITEABOT_FEATURE_LAST_CALLGITEABOT_FEATURE_PR_ACTIONS
Label overrides (defaults match go-gitea/gitea):
GITEABOT_LABEL_BACKPORT_PREFIXGITEABOT_LABEL_BACKPORT_DONEGITEABOT_LABEL_BACKPORT_MANUALGITEABOT_LABEL_REVIEWED_PREFIXGITEABOT_LABEL_REVIEWED_WAIT_MERGEGITEABOT_LABEL_REVIEWED_PRIORITIZE_MERGEGITEABOT_LABEL_PR_LAST_CALLGITEABOT_LABEL_PR_BREAKINGGITEABOT_LABEL_LGTM_PREFIXGITEABOT_LABEL_LGTM_NEED_2GITEABOT_LABEL_LGTM_NEED_1GITEABOT_LABEL_LGTM_DONEGITEABOT_LABEL_LGTM_BLOCKEDGITEABOT_LABEL_BOT_PREFIXGITEABOT_LABEL_UPDATE_BRANCHGITEABOT_LABEL_TOC_REMINDEDGITEABOT_LABEL_NEEDS_FEEDBACKGITEABOT_LABEL_SIZE_PREFIXGITEABOT_LABEL_PR_PREFIX
Example workflow:
name: giteabot
on:
push:
branches: [main]
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize
- review_requested
- review_request_removed
- closed
pull_request_review:
jobs:
giteabot:
runs-on: ubuntu-latest
steps:
- uses: your-org/giteabot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
fork: your-user/gitea
provider: github
api_base: https://api.github.com
mode: event
event_path: ${{ github.event_path }}
event_name: ${{ github.event_name }}Scheduled maintenance (GitHub Actions):
name: giteabot-maintenance
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
giteabot:
runs-on: ubuntu-latest
steps:
- uses: your-org/giteabot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
fork: your-user/gitea
provider: github
api_base: https://api.github.com
mode: maintenanceNotes:
forkshould be a fork of the target repo with write access.- For backports, the token must be able to create branches and PRs.
- You can override labels and feature flags via
envon the step.
Example workflow:
name: giteabot
on:
push:
branches: [main]
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize
- review_requested
- review_request_removed
- closed
pull_request_review:
jobs:
giteabot:
runs-on: ubuntu-latest
steps:
- uses: your-org/giteabot@v1
with:
token: ${{ secrets.GITEA_TOKEN }}
repo: ${{ gitea.repository }}
fork: your-user/gitea
provider: gitea
api_base: https://gitea.com/api/v1
mode: event
event_path: ${{ gitea.event_path }}
event_name: ${{ gitea.event_name }}Scheduled maintenance (Gitea Actions):
name: giteabot-maintenance
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
giteabot:
runs-on: ubuntu-latest
steps:
- uses: your-org/giteabot@v1
with:
token: ${{ secrets.GITEA_TOKEN }}
repo: ${{ gitea.repository }}
fork: your-user/gitea
provider: gitea
api_base: https://gitea.com/api/v1
mode: maintenanceNotes:
- Ensure the token can read/write issues, PRs, and statuses.
api_baseshould match your Gitea server.- You can override labels and feature flags via
envon the step.
Example label/feature overrides:
- uses: your-org/giteabot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
env:
GITEABOT_FEATURE_BACKPORT: "false"
GITEABOT_LABEL_BACKPORT_PREFIX: "bp/"
GITEABOT_LABEL_REVIEWED_WAIT_MERGE: "queue/wait-merge"Run a webhook server (default port 8000):
GITEABOT_MODE=server \
GITEABOT_REPO=go-gitea/gitea \
GITEABOT_FORK=your-user/gitea \
GITEABOT_PROVIDER=github \
GITEABOT_API_BASE=https://api.github.com \
GITEABOT_TOKEN=... \
GITEABOT_WEBHOOK_SECRET=... \
./giteabotConfigure a webhook pointing to http(s)://<host>:8000/trigger.