docs/solutions/workflow-issues/2026-03-26-template-sync-fallback-prs-must-close-after-later-success.md
The release workflow could create a fallback PR on template-sync failure, but a later successful release run left that PR open.
That created zombie PRs like templates/release-sync-failure: stale, conflicted, and already superseded by main.
The workflow was asymmetric:
templates/release-sync-failure PRmainWhat it did not have was a cleanup step that closed an already-open fallback PR after the success path landed.
In release.yml, give the successful template push step an id and add a follow-up cleanup step with actions/github-script.
That cleanup step should:
maintemplates/release-sync-failuremainThe fallback PR is just a recovery artifact. Once a later run proves the templates synced cleanly to main, that artifact is no longer the source of truth.
Closing it automatically keeps the release queue clean and prevents reviewers from staring at a dead PR that CI has already made irrelevant.
Whenever a workflow has:
mainit also needs an explicit cleanup branch that closes any older fallback PRs. GitHub will not do that for free just because the later run skipped the PR-creation step.