fix(github): disambiguate contributors workflow push refspec#1137
fix(github): disambiguate contributors workflow push refspec#1137
Conversation
- Use refs/heads/ for pull and push so tag named main cannot collide with branch main
|
🏆 @muddlebee did not come to play. PR opened. Review survived. Merged clean. Retire the jersey. 🎽 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |
Greptile SummaryThis PR fixes the Confidence Score: 5/5Safe to merge — the change is a minimal, correct fix with no regressions. Both changed lines correctly apply the No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant W as Workflow Runner
participant L as Local Git
participant R as origin (GitHub)
W->>L: git add README.md
W->>L: git diff --staged --quiet || git commit
Note over W,L: Only commits if README changed
alt HEAD has a parent commit
W->>R: git pull --rebase origin refs/heads/${GITHUB_REF_NAME}
Note over W,R: Explicit refs/heads/ avoids tag ambiguity
R-->>L: rebased remote changes
end
W->>R: git push origin HEAD:refs/heads/${GITHUB_REF_NAME}
Note over W,R: Explicit refs/heads/ avoids matches more than one error
Reviews (1): Last reviewed commit: "fix(github): disambiguate contributors w..." | Re-trigger Greptile |

Problem
The Update Contributors workflow fails on push with:
This happens when both
refs/heads/mainandrefs/tags/mainexist;HEAD:mainis ambiguous.Change
Use explicit branch refs for pull/rebase and push:
git pull --rebase origin "refs/heads/${GITHUB_REF_NAME}"git push origin "HEAD:refs/heads/${GITHUB_REF_NAME}"