grocery-app/docs/GITEA_PR_WORKFLOW.md
2026-05-30 23:34:27 -07:00

1.5 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>"

Do not commit tokens, paste them into docs, or print them in logs.

Check auth:

npm run pr:auth

Create a PR

  1. Push the branch first.
  2. Inspect the cumulative branch diff against the PR target:
git log <base>..HEAD --oneline --decorate
git diff --stat <base>..HEAD
  1. Write the PR body to a temporary local file. Include the coordination record required by PROJECT_INSTRUCTIONS.md.
  2. 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.