Skip to content

Harden PR Description Updater to run from trusted merged-PR context#44666

Closed
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/aw-fix-pr-description-updater
Closed

Harden PR Description Updater to run from trusted merged-PR context#44666
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/aw-fix-pr-description-updater

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The PR Description Updater was failing almost entirely before the agent even started: recent runs landed in action_required with zero jobs, so merged PR descriptions were not being rewritten. The failure pattern matched trigger-time approval/gating on merged PR workflow execution rather than a safe-output or sub-agent runtime problem.

  • Trigger and trust model

    • Move the workflow from pull_request to pull_request_target for closed events so merged-PR processing runs from trusted base-repo workflow context.
    • Keep the existing merged-only and signed-branch exclusion gate intact.
  • Checkout hardening

    • Add explicit checkout: frontmatter for the trusted base repository/ref:
      • repository: ${{ github.repository }}
      • ref: ${{ github.event.pull_request.base.ref }}
      • fetch-depth: 0
    • This avoids checking out untrusted PR head content under pull_request_target while still giving the workflow the history it needs to summarize landed changes.
  • Diff source correctness

    • Generate diff stats, commit logs, and chunked diffs against github.event.pull_request.merge_commit_sha instead of the PR head SHA.
    • Fail fast if merge_commit_sha is missing rather than silently falling back to untrusted head context.
  • Generated workflow

    • Recompile pr-description-caveman.lock.yml so the generated workflow reflects the new trigger, checkout policy, and merge-commit-based diffing.
on:
  pull_request_target:
    types: [closed]

checkout:
  repository: ${{ github.repository }}
  ref: ${{ github.event.pull_request.base.ref }}
  fetch-depth: 0
if [ -z "${MERGE_SHA:-}" ]; then
  echo "Missing merge_commit_sha for merged pull_request_target event" >&2
  exit 1
fi

git diff "$BASE_SHA"..."$MERGE_SHA" -- "${EXCLUSIONS[@]}"

Copilot AI and others added 2 commits July 10, 2026 06:48
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix PR description updater 95% failure rate Harden PR Description Updater to run from trusted merged-PR context Jul 10, 2026
Copilot AI requested a review from pelikhan July 10, 2026 06:56
@pelikhan pelikhan closed this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] PR Description Updater — 95% failure rate since Jul 1 (19/20 AR)

2 participants