Skip to content

Update PR Body

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

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

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]

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
  pull-requests: write

jobs:
  run:
    if: github.event.pull_request.draft == false
    uses: elastic/ai-github-actions/.github/workflows/gh-aw-update-pr-body.lock.yml@v0
    secrets:
      COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}