Files
skills/skills/gitea-pr/references/gt-pulls.md
T
kiskaadee b2146510af refactor(code-review,gitea-pr): move guarded PR review publishing to code-review and document org board moves
- skills/code-review/SKILL.md & references/finding-schema.md: keep code-review strictly read-only regarding the codebase while owning owner-approved, commit-pinned --comment PR review publishing (with head_sha and duplicate/pending guards)

- skills/gitea-pr/SKILL.md & references/gt-pulls.md: delegate PR review publishing to code-review, remove duplicate recipe, and ensure Suggested Next Step emits when CI is pending

- skills/implement-slice/references/handoff-contracts.md: document /orgs/<org>/projects/<project-id>/issues/<global-issue-id>/move alongside repo-scoped board moves

- tests/fixtures/test_skills_behavioral_contracts.py: update test_review_comment_publishing_ownership for new boundary
2026-11-18 16:44:16 -05:00

3.1 KiB

Verified gt pr Pull Request Subroutines

Reference for gitea-pr. Canonical, verified syntax for managing pull requests, status checks, and review threads via gt.

1. Inspecting Pull Requests

List Pull Requests

# List open PRs with structured fields
gt pr list --json number,title,state,url

# List all PRs including closed/merged
gt pr list --state all --json number,title,state,url

View Pull Request Details & Status Checks

# View basic PR details
gt pr view <number>

# Inspect mergeability and review decision
gt pr view <number> --json number,title,state,mergeable,review_decision,url

# Show status of CI checks on the head commit
gt pr checks <number>

# Wait for CI checks to complete
gt pr checks <number> --watch

2. Creating and Updating Pull Requests

Create a Pull Request

  • Create standard PR with multi-line body from file:
    gt pr create -t "<title>" -B "<base-branch>" -H "<feature-branch>" -F <body-file> --json number,url
    
  • Create as a Draft / WIP PR:
    gt pr create -t "WIP: <title>" --draft -B "<base-branch>" -H "<feature-branch>" -F <body-file> --json number,url
    
  • Assign milestone and project:
    gt pr create -t "<title>" -B "<base>" -H "<branch>" -m <milestone-id> -p <project-id> -F <body-file> --json number,url
    

Edit a Pull Request

# Update title or base branch
gt pr edit <number> --title "<new-title>"

# Mark a draft PR as ready for review
gt pr ready <number>

3. Review Comments and Discussions

List Review Comments

# List inline review comments
gt pr review comments <number>

# View PR activity and top-level comments
gt pr timeline <number>

Reply to Review Comments

# Reply to an inline comment
gt pr review reply <number> <comment-id> "Fixed in <sha>"

# Add top-level comment
gt pr comment <number> -b "<comment-text>"

Resolve Review Comments

# Mark an inline thread as resolved
gt pr review resolve <comment-id>

# Reopen an inline thread
gt pr review unresolve <comment-id>

(Publishing new code-review PR review blocks is owned by code-review in skills/code-review/references/finding-schema.md.)


4. Closing and Merging Pull Requests

Close or Reopen PR

gt pr close <number>
gt pr reopen <number>

Merge Pull Request and Move Card Review -> Completed (Requires Explicit Human Authorization)

Release and merge authority belongs exclusively to the human owner. Once the owner explicitly approves merging:

# 1. Merge pull request (fast-forward / merge commit, or --squash --delete-branch)
gt pr merge <number>

# 2. Extract global issue ID of the linked issue and move its project board card to Completed
issue_global_id=$(gt issue view <issue-number> --json id -q .id)
gt api -X POST /repos/{owner}/{repo}/projects/<project-id>/issues/${issue_global_id}/move -F column_id=<completed-col-id>

Do not attach the PR itself (-p <project-id>) as a duplicate board card when the linked issue is already on the board; if a PR card was attached separately, move it to Completed as well.