Primary finding
Reusing date-based branch name can cause non-fast-forward push failures if an existing sync branch diverged
- .github/workflows/sync-upstream.yml:51-53
- .github/workflows/sync-upstream.yml:64-66
The branch name is reused for all runs on the same day. If a previous run opened a PR and maintainers (or CI) pushed additional commits to that branch, the next run creates a fresh local branch and attempts a non-forced push, which will fail with a non-fast-forward error. The workflow does not detect or handle this case, leading to intermittent failures and stale PRs.
Recommendation
Before creating the branch, check if the remote branch exists and base the local branch on it (e.g., `git fetch origin "$BRANCH" || true` and `git checkout -B "$BRANCH" origin/"$BRANCH"`), then merge upstream and push. Alternatively, make the branch name unique per run (include timestamp or upstream commit hash) and rely on PR auto-update using `gh pr create --fill --head "$BRANCH"` accordingly.