From 302fa1a2f83b5732660f57c77d37df6046ae6f1d Mon Sep 17 00:00:00 2001 From: autogame-17 <17@evomap.ai> Date: Wed, 5 Aug 2026 13:33:46 +0800 Subject: [PATCH] fix(pr-gate): read current base ref for metadata checks Sync evolver-copilot-plugin with the upstream pr-gate workflow fix from engineering-operating-system#19. The workflow still uses pull_request_target and never checks out PR-head code, but PR events now checkout the current base branch ref instead of the event base SHA so legacy PR body edits can resolve after the check becomes required. Co-Authored-By: Claude Fable 5 --- .github/workflows/pr-metadata-policy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-metadata-policy.yml b/.github/workflows/pr-metadata-policy.yml index bb3b4fe..dd69ebb 100644 --- a/.github/workflows/pr-metadata-policy.yml +++ b/.github/workflows/pr-metadata-policy.yml @@ -41,8 +41,12 @@ jobs: uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: # For merge_group there is no pull_request payload; the default ref is - # already the queued candidate, so leave it alone in that case. - ref: ${{ github.event.pull_request.base.sha || '' }} + # already the queued candidate, so leave it alone in that case. For + # pull_request_target, read the current base branch by name rather than + # the event's base SHA: old PRs keep the SHA from the base they were + # opened against, which can predate this validator and leave a newly- + # required check permanently red after a body edit. + ref: ${{ github.event.pull_request.base.ref || '' }} # Only the template and the validator are read. No history needed. fetch-depth: 1