Skip to content

Commit 7ede4cd

Browse files
committed
fix(github): disambiguate contributors workflow push refspec
- Use refs/heads/ for pull and push so tag named main cannot collide with branch main
1 parent 72dd2cc commit 7ede4cd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/contributors.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159
git add README.md
160160
git diff --staged --quiet || git commit -m "docs(contributor): contrib-readme-action has updated readme"
161161
if git rev-parse --verify HEAD^ >/dev/null 2>&1; then
162-
git pull --rebase origin "${GITHUB_REF_NAME}"
162+
git pull --rebase origin "refs/heads/${GITHUB_REF_NAME}"
163163
fi
164-
git push origin "HEAD:${GITHUB_REF_NAME}"
164+
# refs/heads/ avoids ambiguity when a tag shares the branch name (e.g. tag "main").
165+
git push origin "HEAD:refs/heads/${GITHUB_REF_NAME}"

0 commit comments

Comments
 (0)