1.8 KiB
Gitea PR Workflow
Use this workflow when creating or merging PRs for this repo. It is designed for Codex and local operators to use the same commands without storing secrets in git.
One-time token setup
Create a Gitea access token with repository pull request permissions, then set it only in the shell or user environment:
$env:GITEA_BASE_URL = "http://192.168.7.78:3000"
$env:GITEA_TOKEN = "<token>"
For Codex sandbox sessions, use the ignored local env file when inherited environment variables are not visible:
@"
GITEA_BASE_URL=http://192.168.7.78:3000
GITEA_TOKEN=<token>
"@ | Set-Content .codex-local.env
Do not commit tokens, paste them into docs, or print them in logs.
Check auth:
npm run pr:auth
Create a PR
- Push the branch first.
- Inspect the cumulative branch diff against the PR target:
git log <base>..HEAD --oneline --decorate
git diff --stat <base>..HEAD
- Write the PR body to a temporary local file. Include the coordination record required by
PROJECT_INSTRUCTIONS.md. - Create the PR:
npm run pr:create -- --base <base> --title "<title>" --body-file <body-file>
The helper checks for an existing open PR with the same base/head and returns it instead of creating a duplicate.
For stacked work, pass the parent PR branch as <base>. For standalone work, pass main.
View or merge a PR
View:
npm run pr:view -- --number <pr-number>
Merge after explicit operator approval and required checks:
npm run pr:merge -- --number <pr-number> --method merge --delete-branch --yes
The helper refuses to merge without --yes. Use --method squash or --method rebase only when that is the intended repo workflow.