Skip to content

Commit 35d1769

Browse files
chirag-madlaniAuto-revert Testclaude
authored
ci(playwright): don't fail merge-group runs when baseline push is ruleset-blocked (#31983)
The direct-commit baseline refresh (#31907) hit main's repository ruleset (GH013: changes must go through the merge queue) because the workflow token has no bypass grant yet. The job treated that as 'main moved, retry' and failed after 3 attempts — turning every full-mode merge_group run red and ejecting innocent PRs (runs 32750389130, 32750390655): the exact failure mode the pipeline exists to prevent. Detect ruleset rejections in the push output and degrade to a loud ::warning + job-summary note + graceful skip; keep the retry loop and hard failure for genuine push races. Auto-refresh stays inert until a maintainer grants the token bypass on the main ruleset. Co-authored-by: Auto-revert Test <test-auto-revert@example.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent a94404d commit 35d1769

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/playwright-postgresql-e2e.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,29 @@ jobs:
670670
-m "chore(playwright): auto-refresh timing baseline from run ${RUN_ID} [skip ci]" \
671671
-m "$(cat "$RUNNER_TEMP/baseline-refresh-summary.md")" \
672672
-m "Source: ${RUN_URL}"
673-
if git push origin HEAD:main; then
673+
push_rc=0
674+
push_output=$(git push origin HEAD:main 2>&1) || push_rc=$?
675+
echo "$push_output"
676+
if [[ "$push_rc" -eq 0 ]]; then
674677
echo "Baseline refreshed on main (attempt $attempt)."
675678
exit 0
676679
fi
680+
# A ruleset/branch-protection rejection (GH013: "changes must be
681+
# made through the merge queue") is a CONFIGURATION gap, not a
682+
# pipeline failure: the token identity is not on main's bypass
683+
# list yet. Failing the job here turns every full-mode
684+
# merge_group run red and ejects innocent PRs (runs 32750389130,
685+
# 32750390655) — the exact failure mode this pipeline exists to
686+
# prevent. Surface loudly, skip gracefully.
687+
if grep -qE "GH013|rule violations|protected branch" <<< "$push_output"; then
688+
echo "::warning::Baseline refresh skipped: push to main rejected by repository ruleset (GH013). Grant the workflow token (RELEASE_BOT_TOKEN or Actions) bypass on main's ruleset to enable auto-refresh."
689+
{
690+
echo "## ⚠️ Timing-baseline auto-refresh blocked by ruleset"
691+
echo
692+
echo "The direct push to \`main\` was rejected (GH013). The refresh is skipped — downstream planning keeps using the current baseline. Grant the workflow token bypass on the main ruleset to enable it."
693+
} >> "$GITHUB_STEP_SUMMARY"
694+
exit 0
695+
fi
677696
echo "Push rejected (main moved during refresh); retrying." >&2
678697
done
679698

0 commit comments

Comments
 (0)