Files
docs/cli-docs/ci.md
T
silverwindandClaude 8594d73ccd docs: tighten the gt guides and the cli wiring
The workflow example had no trigger, so Gitea would reject it as written.
The guides now merge the small account sections and point users at the
nightly builds they describe. Comments and READMEs no longer mention the
dropped reference generator or list the runner as the only hand written
sidebar product, and the sidebar lookup drops a key the fallback covers.

Co-Authored-By: Claude (Opus 5.5) <[email protected]>
2026-10-22 22:06:45 +02:00

41 lines
1.0 KiB
Markdown

---
sidebar_position: 4
---
# Using gt in CI
Give gt a token and an instance through the environment, and turn prompts off:
| Variable | Description |
| --- | --- |
| `GITEA_TOKEN` | Access token; gt never stores it |
| `GITEA_CLI_HOST` or `GITEA_INSTANCE_URL` | URL of the instance |
| `GITEA_CLI_REPO` | Repository, like `--repo` |
`--no-input` makes a command fail instead of prompting, and `--yes` confirms changes in
advance.
## Gitea Actions
Gitea does not allow secret names that start with `GITEA_`, so store the token as, for
example, `GT_TOKEN`:
```yaml
on:
push:
branches: [main]
jobs:
staging:
runs-on: ubuntu-latest
env:
GITEA_TOKEN: ${{ secrets.GT_TOKEN }}
GITEA_CLI_HOST: ${{ gitea.server_url }}
GITEA_CLI_REPO: ${{ gitea.repository }}
steps:
- run: curl -fsSL https://gitea.com/gitea/cli/raw/branch/main/scripts/install.sh | sh
- run: gt workflow run deploy.yml --ref main --field env=staging --no-input
```
`gt run watch` and `gt pr checks --watch` wait for runs and checks and fail when one fails.