From 68d6896d1672e2c9345b90f5836a558ea8fded0b Mon Sep 17 00:00:00 2001 From: Shaojin Wen Date: Mon, 20 Jul 2026 13:47:15 +0800 Subject: [PATCH] fix(ci): create remote-tracking ref for fork PRs in autofix verify gate The verification gate compares origin/${BRANCH}...${BRANCH} to detect new commits, but fork PRs fetch via URL into FETCH_HEAD without creating the remote-tracking ref. The git-diff fatal error is misread as "branch changed", failing the gate when the agent correctly wrote no-action.md. --- .github/workflows/qwen-autofix.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/qwen-autofix.yml b/.github/workflows/qwen-autofix.yml index 568b2ce7ee9..bf82e3c4ae8 100644 --- a/.github/workflows/qwen-autofix.yml +++ b/.github/workflows/qwen-autofix.yml @@ -2111,6 +2111,10 @@ jobs: exit 0 fi git checkout -B "${BRANCH}" FETCH_HEAD + # Create the remote-tracking ref so the verification gate's + # `git diff --quiet "origin/${BRANCH}...${BRANCH}"` works for + # fork PRs the same way it does for same-repo branches. + git update-ref "refs/remotes/origin/${BRANCH}" "${BRANCH}" # Allow-edits pushes ride the classic-PAT grant — GITHUB_TOKEN # and fine-grained PATs are documented as NOT receiving it. # Prove push access NOW, before an agent round is spent, instead