pre-commit-ci / issues

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

pre-commit ci action lite merging a PR from a fork #179

Closed itsarune closed 1 year ago

itsarune commented 1 year ago

Hello, our developers write code in their own forks of our public repo and then merge pull requests to our master branch by merging across forks. This is an example of such a PR. I installed the "pre-commit ci lite" action for the repo. I am using a custom formatting fix script that we defined a hook for in .pre-commit-config.yaml. I am able to trigger this formatting script and obtain a diff from pre-commit. I also see the following messages in pre-commit-ci-lite:

fetching pr...
saving artifact...
artifact published!

However, we don't see any commit pushed to fix the changes made by our fix formatting script. I only see a message that says: "pre-commit.ci lite Pending — running" in the status checks at the bottom of the PR.

Would pre-commit work in this situation where the base of the pull request is a fork of the repo?

asottile commented 1 year ago

weird -- can you try rerunning the action? the error on pre-commit ci's side is:

[ERROR] AssertionError: no artifact? repo_id=141040516 run_id=4684507328
itsarune commented 1 year ago

I reran the action and looks like the same thing is happening

asottile commented 1 year ago

very strange -- this is working elsewhere so there's something special about this case. for some reason pre-commit ci can't even read the github actions artifacts for that PR

itsarune commented 1 year ago

we fixed this by running pre-commit in a separate workflow file as per @asottile's suggestion and now works. should this issue be closed?

asottile commented 1 year ago

I think I need to document that still -- or figure out some way to not need the full workflow to complete