-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Failing because the branch
already exists
#245
Comments
I think this is the same problem as described in #177. I could really use help from a |
perhaps @ethomson could help or knows someone who could? ❤️ |
Well, here's what I'm seeing. @bnb's run first checks out the But the stack trace says that it failed to create a local
This So... something threw between the checkout step (which sent output indicating its success) and returning from the function. That means that the If it were me, I would:
I don't have a guess yet for why the |
Thanks Edward, I'll look into this tomorrow |
hey @gr2m! 👋🏻 wanted to follow up to see if that was the right path? |
sorry I didn't have a chance to look into it yet, but I have it on my todo list. I'll bump it to the top and keep you posted |
I tried a few things to intentionally reproduce the problem but had no luck. If anyone could help me produce a test case I'd appreciate it. For now I'll add more error logging as suggested by @ethomson |
Can you add a |
I think the solution is to simplify the git commands in the first place. What I want is to update an existing branch I don't want to commit the changes to main, I want to commit them to What would the git commands be you would use in such a situation? |
Ugh, this is one of those places where what you describe is relatively easy in the data modelling side (and I could whip you up some libgit2 to do this quite easily) but I'm not 100% sure what the git commands are to get you there. I think that using git itself, I'd let it do the work against an alternate index file (in other words, stage all those changes, but not against the repository index, so the repo will still see them as unchanged), and create a commit from it and then set that to the head of I think that this will work: TMPFILE=$(mktemp)
# add the files to the temporary staging area
GIT_INDEX_FILE="${TMPFILE}" git add .
# turn the temporary staging area into a tree object
TREE_ID=$(GIT_INDEX_FILE="${TMPFILE}" git write-tree)
# create a commit that points to that tree object
COMMIT_ID=$(git commit-tree -p HEAD -m 'commit message goes here' $TREE_ID)
# create or update the branch to the new commit
git branch -f 'branch_name_goes_here' $COMMIT_ID |
Here's the run, @gr2m: https://github.com/bnb/node/actions/runs/362043074 |
Thanks @ethomson! Maybe we can make the current version work, but if not, I'll try the commands you suggested. Regarding Thanks @bnb, here is the full error we are facing
It sounds like the problem is
Sounds like this could be fixed by adding so the action was triggered, no change occurred, and that's why the cherry pick failed somehow? I wish I could reproduce the state with pure git commands for easier debugging, I didn't manage to yet. |
that resolves "The previous cherry-pick is now empty, possibly due to conflict resolution" error. Ref #245
That did not seem to have worked 🤷🏼 But running |
🎉 This issue has been resolved in version 1.3.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
yay! Thank you all for your help! |
Perhaps I'm just misunderstanding how the
branch
property in the config is supposed to work, but in using it after the initial run where it was created the Action is failing on every subsequent run with the assertion thatgit checkout -b <branch>
already exists.Here's an example run:
https://github.com/bnb/node/runs/1327432876
Here's the error:
The text was updated successfully, but these errors were encountered: