update-pr-body
Update the body of a GitHub pull request. Use when the user asks to update, edit, or modify a PR description/body.
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Update the body of a GitHub pull request. Use when the user asks to update, edit, or modify a PR description/body.
How to use
Pobierz numer aktualnego pull requesta na podstawie gałęzi, na której pracujesz, używając polecenia
gh pr list --head "$(git branch --show-current)" --json number --jq '.[0].number'.Przejrzyj obecną zawartość opisu PR poleceniem
gh pr view <numer-pr> --json body -q '.body', aby zobaczyć, co już tam jest.Przygotuj nową treść opisu PR, którą chcesz wstawić (może to być podsumowanie zmian, plan testów, notatki itp.).
Zaktualizuj opis PR za pomocą REST API GitHub:
gh api -X PATCH /repos/{owner}/{repo}/pulls/<numer-pr> -f body="Nowa treść opisu tutaj".Jeśli chcesz dodać zawartość do istniejącego opisu zamiast go zastępować, najpierw przechwyć obecny tekst do zmiennej (
CURRENT_BODY=$(gh pr view <numer-pr> --json body -q '.body')), a następnie dołącz nowy tekst w poleceniu PATCH (body="${CURRENT_BODY}\n\nNowa zawartość")