-
Notifications
You must be signed in to change notification settings - Fork 23
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
📝 Update docstring generator to include target branch for push #477
Conversation
Then the changes of #475 can probably be reverted right? |
I think it's not possible to push to the branch like that, also |
ah great! Thank you! |
@Drewniok @simon1hofmann does this work as intended now? |
@marcelwa Not yet |
Alright, keep me posted |
@marcelwa It works now! Thanks @simon1hofmann for your help. |
@@ -20,6 +16,7 @@ jobs: | |||
uses: actions/checkout@v4 | |||
with: | |||
submodules: recursive | |||
fetch-depth: 0 # Fetch all history for all branches and tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this important?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the docstring generator only worked for branches forked directly from fiction
and not, e.g., Drewniok/fiction
, which lead to this error message:
Error: Error: fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push origin HEAD:<name-of-remote-branch>
By default, fetch-depth
is set to 1, so something similar like this happens:
git fetch --depth 1 origin $GITHUB_REF
I guess this misses the forked branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Many thanks!
Description
The docstring generator workflow successfully runs when merging branches originating from
upstream-main
. However, it fails to push docstrings during workflow execution for branches originating fromfork-main
due to detached branches.This PR resolves the issue by specifying the target branch for pushing docstrings.
Thanks @simon1hofmann for helping to figure this out!
Checklist: