From d8cd8409759f22ef2b91acb8bf01ee142f087566 Mon Sep 17 00:00:00 2001 From: autogame-17 <17@evomap.ai> Date: Wed, 5 Aug 2026 14:17:48 +0800 Subject: [PATCH] fix(pr-gate): read default branch metadata contract Sync evolver-cursor-plugin with engineering-operating-system#20. The metadata gate still uses pull_request_target and never checks out PR-head code, but PR events now checkout the base repository default branch instead of a possibly stale stacked-PR base branch. Co-Authored-By: Claude Fable 5 --- .github/workflows/pr-metadata-policy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-metadata-policy.yml b/.github/workflows/pr-metadata-policy.yml index dd69ebb..4f09617 100644 --- a/.github/workflows/pr-metadata-policy.yml +++ b/.github/workflows/pr-metadata-policy.yml @@ -42,11 +42,11 @@ jobs: 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. 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 || '' }} + # pull_request_target, read the base repository's default branch rather + # than the PR's base ref/SHA: stacked PRs often target feature branches + # created before this gate existed, so reading that base can miss the + # validator and leave a newly-required check permanently red. + ref: ${{ github.event.pull_request.base.repo.default_branch || '' }} # Only the template and the validator are read. No history needed. fetch-depth: 1