pre-commit-ci / issues

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

auto-fix not working for forked pull request #127

Closed lordwelch closed 2 years ago

lordwelch commented 2 years ago

I am trying to test the auto fixing feature of pre-commit.ci and I can't seem to get it to work if the pull request comes from a fork.

Pull request in same repo: https://results.pre-commit.ci/run/github/206023389/1654551283.nnWloOEtQy-ncZNe7_OZww Pull request from forked repo: https://results.pre-commit.ci/run/github/206023389/1654551280.Gx_P8cYtR4yUHqz0KHzFvA

asottile commented 2 years ago

it looks like the organization settings of https://github.com/welchsoftwaredevelopers prevents pre-commit-ci[bot] from pushing to any branch

lordwelch commented 2 years ago

Looks like my issue was trying to test with an organization rather than a separate user. Though I'm not sure what the setting I would need to change would be to make it work.

asottile commented 2 years ago

yeah I forget where the setting is :S -- it has to do with whether the repo owners can contribute to the PR branch

asottile commented 2 years ago

ah just saw the invite @lordwelch -- there's both pre-commit-ci-bot (a user) and pre-commit-ci[bot] a bot account (yeah confusing I know!) -- I think to invite the bot you need to allow 66853113+pre-commit-ci[bot]@users.noreply.github.com ?

lordwelch commented 2 years ago

I must be missing something I've already added the app to the repository but it seems to be running into the same issue pre-commit run and manually adding a GitHub bot account to a organization that requires an invitation to be accepted doesn't seem reasonable.

asottile commented 2 years ago

yeah it's very weird. it should work. maybe open an issue with github support?

Jun 06 21:35:05 ip-172-31-78-110 python3[802]: ====> pushing...
Jun 06 21:35:07 ip-172-31-78-110 python3[8486]: [test d5c0df4] [pre-commit.ci] auto fixes from pre-commit.com hooks
Jun 06 21:35:07 ip-172-31-78-110 python3[8486]:  Date: Mon Jun 6 21:35:05 2022 +0000
Jun 06 21:35:07 ip-172-31-78-110 python3[8486]:  1 file changed, 1 insertion(+), 2 deletions(-)
Jun 06 21:35:07 ip-172-31-78-110 python3[802]: =======> cherry picked!
Jun 06 21:35:07 ip-172-31-78-110 python3[8489]: remote: Permission to WelchSoftwareDevelopers/CT.git denied to pre-commit-ci[bot].
Jun 06 21:35:07 ip-172-31-78-110 python3[8489]: fatal: unable to access 'https://github.com/WelchSoftwareDevelopers/CT/': The requested URL returned error: 403
asottile commented 2 years ago

very weird -- it used to work, but now doesn't work for my accounts either: https://github.com/asottile/astpretty/pull/104

lordwelch commented 2 years ago

There is this checkbox when creating a pull request which is missing when using an organization fork. So that may explain why that does not work. Though what I actually want is a repository on an organization that can use the auto-fix. I have opened a ticket with GitHub Support. image