Skip to content
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

Unable to find PR on push event #437

Closed
ggreco opened this issue Apr 7, 2023 · 5 comments · Fixed by #438
Closed

Unable to find PR on push event #437

ggreco opened this issue Apr 7, 2023 · 5 comments · Fixed by #438

Comments

@ggreco
Copy link

ggreco commented Apr 7, 2023

It seems that the action is not able to find the PR to add the comment to if it's executed in a script that runs on a push event and not on a pull_request event:

image

I had similar problems with https://github.com/platisd/clang-tidy-pr-comments but that action has an additional parameter to specify the PR is running on, and, from a commit, it's possible to get the PR using for instance:

https://github.com/jwalton/gh-find-current-pr

I suggest, if possible to add a pull_request_id option to be used as target PR when the action silently fail with There is no pull request for commit XYZ like in the provided screenshot.

@EnricoMi
Copy link
Owner

EnricoMi commented Apr 7, 2023

Yes, when there is no pull request given in the event (given for pull_request events), than the action should fall back to the commit's pull requests. Will revert behaviour change from v2.6.1 and add this fall back. See #438.

@ggreco
Copy link
Author

ggreco commented Apr 11, 2023

BTW looking at the source code I found the option search_pull_request (undocumented in README.md) and setting that to true I've been able to get the comment published/updated in the PR.

@EnricoMi
Copy link
Owner

This fix has been released, please try without search_pull_request, as this should work now.

@ggreco
Copy link
Author

ggreco commented Apr 11, 2023

I can confirm it to work properly now also without search_pull_request, thanks!

@EnricoMi
Copy link
Owner

Awesome, thanks for testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants