Skip to content

Conversation

@michaelglass
Copy link

@michaelglass michaelglass commented Oct 31, 2022

When I followed the instructions, I received the following error:

> Pushing pull request branch to 'origin/bundle-update-1667232038'
  /usr/bin/git push --force-with-lease origin HEAD:refs/heads/bundle-update-1667232038
  To github.com:****/****.git
   ! [remote rejected] HEAD -> bundle-update-1667232038 (shallow update not allowed)
  error: failed to push some refs to 'github.com:****/****.git'

this setting fetch-depth: 0 in the checkout action, which does an unshallow clone, resolved the issue.

When I followed the instructions, I received the following error:

```
> Pushing pull request branch to 'origin/bundle-update-1667232038'
  /usr/bin/git push --force-with-lease origin HEAD:refs/heads/bundle-update-1667232038
  To github.com:****/****.git
   ! [remote rejected] HEAD -> bundle-update-1667232038 (shallow update not allowed)
  error: failed to push some refs to 'github.com:****/****.git'
```

this setting `fetch-depth: 0` in the checkout action resolved the issue.
@peter-evans
Copy link
Owner

Hi @michaelglass

Please could you show me the workflow where this occurred? I want to understand the conditions that made this necessary. There are definitely cases where this isn't necessary. For example, this test case.

@michaelglass
Copy link
Author

here's the workflow

Maybe the difference is in the test case, you're pushing a new file and in my example, I'm updating an existing file?

@peter-evans
Copy link
Owner

Thank you for the workflow.

Maybe the difference is in the test case, you're pushing a new file and in my example, I'm updating an existing file?

It's actually an update, not a new file. You can see the file checked in here.

I'm very confused about why this is happening in your workflow. Normally, this error only occurs if you are pushing to a new repository. When pushing to a branch in the same repository it should not occur I think.

@michaelglass
Copy link
Author

strange. Will try again without fetch-depth

(side note: it's delightful to have feedback on an issue or PR soon after opening it. thank you!)

@michaelglass
Copy link
Author

well... unsurprisingly it worked. Sorry to waste your time!

I wonder where the original error came from 🤷‍♀️

@michaelglass michaelglass deleted the patch-1 branch November 1, 2022 07:11
@peter-evans
Copy link
Owner

No worries 😄

If you figure it out please let me know because it might be a strange edge case that I can document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants