-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fatal: You are not currently on a branch. #317
Comments
I seem to get the same ... I am running on a self-hosted runner that generates files and would like to commit back to the repo but get exactly the same as above. |
I had same issue running push command in pull request. I managed to dig down into this old issue. It seems like the problem is that pull requests are not the same as regular branches, and solution ended up being to add this configuration option to my script:
|
1. pull request events are "funny", so we need to check out using `github.event.pull_request.head.ref` if the workflow step will commit anything. See actions/checkout#317 (comment) 2. Regular push events just check out the regular branch, but if this is enabled on multiple branches we need the ability to get the branch name dynamically. Use the new `GITHUB_REF_NAME` variable.
Two years later. uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }} |
3 years later I also had this problem
solved it for me |
* Try committing result * fix indent * fix cmd * try-token * Tryfix * try again * Try again * try docs suggested method * try simpler thing * ah wrong perms at top * try agian * Try actions/checkout#317 * try actions/checkout#719 * Generated protofile changes * Try again * Generated protofile changes * use proper paths filtering * Make it do make proto-all * Rename workflow, add go.sum to diff list --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: devbot-wizard <[email protected]>
* Try committing result * fix indent * fix cmd * try-token * Tryfix * try again * Try again * try docs suggested method * try simpler thing * ah wrong perms at top * try agian * Try actions/checkout#317 * try actions/checkout#719 * Generated protofile changes * Try again * Generated protofile changes * use proper paths filtering * Make it do make proto-all * Rename workflow, add go.sum to diff list --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: devbot-wizard <[email protected]>
This solution is a life saver. Thanks! |
This also resolved our issue. Thanks a lot. |
Fixing as per actions/checkout#317
config
log
tried (not working)
The text was updated successfully, but these errors were encountered: