github-pr-edit

GitHub PR Edit (Title/Body/Comments)

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "github-pr-edit" with this command: npx skills add yiyousiow000814/xauusd-calendar-agent/yiyousiow000814-xauusd-calendar-agent-github-pr-edit

GitHub PR Edit (Title/Body/Comments)

Edit PR title/body/comments on Windows. Use gh when available; otherwise use the GitHub REST API.

Before You Start

  • Identify:

  • owner and repo (e.g. yiyousiow000814/XAUUSD-Calendar-Agent )

  • PR number (e.g. 111 )

  • If using gh , confirm it is available and authenticated:

gh --version gh auth status

  • If the repo is private, unauthenticated GitHub API requests often return 404 Not Found . Treat 404 as “likely unauthorized” unless you are sure the repo/PR does not exist.

Option A (Preferred): GitHub CLI (gh )

If gh is installed and authenticated:

Update title and body (use stdin/body-file to avoid literal \n issues)

@' <markdown body> '@ | gh pr edit 111 --title "chore: ..." --body-file -

Add a comment:

@' Summary:

  • ... '@ | gh pr comment 111 --body-file -

Option B: GitHub REST API (PowerShell, no gh )

  1. Get an auth token (do not print it)

Preferred sources (pick the first available):

  • $env:GITHUB_TOKEN or $env:GH_TOKEN

  • Reuse the credential Git already has (works if you previously authenticated with a PAT):

$cred = "protocol=httpsnhost=github.comn`n" | git credential fill $token = (($cred | Select-String -Pattern '^password=').Line).Substring(9)

Do not Write-Host $token , do not log headers.

  1. Build headers (minimal)

$headers = @{ Authorization = "token $token" 'User-Agent' = 'codex-cli' Accept = 'application/vnd.github+json' }

  1. Sanity check auth (useful when you see 404)

Invoke-RestMethod -Method Get -Uri "https://api.github.com/repos/&#x3C;owner>/&#x3C;repo>" -Headers $headers | Select-Object full_name, private

If this fails with 404 , your token likely lacks access.

  1. Update PR title/body

Use UTF-8 bytes for reliable encoding (Chinese text, punctuation).

$payload = @{ title = 'chore: ...' body = @" Summary:

  • ... "@ } | ConvertTo-Json -Depth 5

$bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)

Invoke-RestMethod -Method Patch -Uri "https://api.github.com/repos/&#x3C;owner>/&#x3C;repo>/pulls/&#x3C;number>" -Headers $headers -ContentType 'application/json; charset=utf-8' -Body $bytes

  1. Add a PR comment (optional)

PR comments are issue comments:

$payload = @{ body = "Summary:`n- ..." } | ConvertTo-Json -Depth 5 $bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)

Invoke-RestMethod -Method Post -Uri "https://api.github.com/repos/&#x3C;owner>/&#x3C;repo>/issues/&#x3C;number>/comments" -Headers $headers -ContentType 'application/json; charset=utf-8' -Body $bytes

Deterministic Helper Script (Recommended)

Use the bundled script for fewer quoting/encoding mistakes:

  • .codex/skills/github-pr-edit/scripts/patch_pr.ps1

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

commit-push-pr-workflow

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

ui-check-framework

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

frontend-design

No summary provided by upstream source.

Repository SourceNeeds Review