fix: resolve "invalid reference" error in contributors workflow (#12) - #13
Merged
udaycodespace merged 1 commit intoJul 17, 2026
Conversation
…despace#12) On pull_request: closed events, the runner checks out the merged PR's source branch (e.g. feat/issue-10-readme-contributors) which is deleted after merge. git-auto-commit-action then fails with: fatal: invalid reference: feat/issue-10-readme-contributors Fix: - Add ref: main to actions/checkout so the job always works on main - Add branch: main to git-auto-commit-action so commits always land on main
|
🚨 @Aryanbuha890, pull requests modifying GitHub actions/workflows from forks are automatically closed for repository security. Maintainers will review and manually implement updates if needed. |
Contributor
Author
|
@udaycodespace Please check it and verify it, here i set the referene of main in this file for automate. |
Owner
I will review tonight! |
Owner
|
@Aryanbuha890 fix works, verified both lines. lgtm!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Fixes #12
What was broken
After PR #11 merged, the contributors workflow failed every time with:
fatal: invalid reference: feat/issue-10-readme-contributors Error: Invalid status code: 128
Root Cause
On
pull_request: closedevents, GitHub checks out the merged PR's source branch(e.g.
feat/issue-10-readme-contributors) — notmain. After the PR merges, that sourcebranch gets deleted. So when
git-auto-commit-actiontried to push a README update backto that deleted branch ref, it failed with the invalid reference error.
Fix — 2 lines changed in
.github/workflows/update-contributors.ymlBefore: