pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

"pre-commit.ci lite was unable to push to the branch -- branch missing?" Error #205

Closed lucasssvaz closed 5 months ago

lucasssvaz commented 5 months ago

While configuring pre-commit.ci lite for our repo it suddenly started failing with the error "pre-commit.ci lite was unable to push to the branch -- branch missing?" as seen in this PR:

https://github.com/espressif/arduino-esp32/pull/9132

I don't know if I messed something up or there's something wrong in the backend. (Btw, this error message is not very useful by itself. Would it be possible to make the error more specific or provide a log?)

asottile commented 5 months ago

unfortunately there's no more additional information. I don't actually know why github rejected the push (usually it means the app got revoked or the branch was deleted or there's a conflict)

lucasssvaz commented 5 months ago

The app permissions are ok and the branch still exist. What kind of conflict could be happening ?

asottile commented 5 months ago

for instance if the auto fixes conflict with the main branch's progression

lucasssvaz commented 5 months ago

Just tried and it isn't. It works correctly in my own for but not when I add it to our organization (as an admin). The same PR:

https://github.com/espressif/arduino-esp32/pull/9132 https://github.com/lucasssvaz/arduino-esp32/pull/4

Do you have any idea what could cause this ? I already checked the things you mentioned and they all seem OK. Is there any special config or permissions required for organization repos ?

asottile commented 5 months ago

ah yes this problem. PRs from an organization to an external repo cannot be pushed at all. this is just an annoying github limitation. it's recommend sending in a support issue to github itself such that they know more people want this

lucasssvaz commented 5 months ago

Is this a limitation in the non-lite version as well ? (I guess it is as this is github related)

asottile commented 5 months ago

yep, there's a special error message in the full version for this case, I can probably add it to lite as well

lucasssvaz commented 5 months ago

I would be very useful for future users, thank you!

lucasssvaz commented 5 months ago

Found out the problem. It was the hooks editing the .github folder, which they don't have permissions. Once I added it to the exclusions list, it worked as expected.

asottile commented 4 months ago

I've added more specific error messages based on the push output -- hopefully that'll make this less confusing next time (there's also a special message for workflows being modified as well!)

lucasssvaz commented 4 months ago

Thanks a lot!