Skip to content

Update PR Body

Keep pull request bodies in sync with the code changes on every commit.

Workflow source: gh-aw-update-pr-body.md

The updater also deduplicates any previously appended runtime footer text in the PR body before rewriting, so repeated runs do not stack duplicate footer blocks.

Quick Install

mkdir -p .github/workflows && curl -sL \
  https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/update-pr-body/example.yml \
  -o .github/workflows/update-pr-body.yml

Trigger

Event Types Condition
pull_request opened, synchronize, reopened, ready_for_review PR is not a draft and does not have skip-pr-body-update label

Inputs

Input Description Required Default
additional-instructions Repo-specific instructions appended to the agent prompt No ""
setup-commands Shell commands run before the agent starts No ""
allowed-bot-users Allowlisted bot actor usernames (comma-separated) No github-actions[bot]
edit-accuracy How aggressively to fix factual inaccuracies (high/low/none) No low
edit-completeness How aggressively to add missing information about significant changes (high/low/none) No low
edit-format How aggressively to improve markdown formatting and structure (high/low/none) No none
edit-style How aggressively to improve writing style and clarity (high/low/none) No none

Edit Levels

Each edit dimension accepts one of three levels:

Level Meaning
high Apply the agent's best judgment; proactively improve this dimension throughout the body
low Make only conservative fixes for clear problems; do not restructure or rewrite
none Do not touch this dimension at all; leave it exactly as the author wrote it

Safe Outputs

  • update-pull-request — update the PR body when significant drift is detected

Example Workflow

name: Update PR Body
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

permissions:
  contents: read
  issues: read
  pull-requests: write

jobs:
  run:
    if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'skip-pr-body-update')
    uses: elastic/ai-github-actions/.github/workflows/gh-aw-update-pr-body.lock.yml@v0
    secrets:
      COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}