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

PR Commenting bot doesn't work with forked repo's creating a PR #37

Open
Baklap4 opened this issue Apr 19, 2022 · 12 comments · May be fixed by #38
Open

PR Commenting bot doesn't work with forked repo's creating a PR #37

Baklap4 opened this issue Apr 19, 2022 · 12 comments · May be fixed by #38

Comments

@Baklap4
Copy link

Baklap4 commented Apr 19, 2022

Within Performous we're trying to use the PR Commenting. All works fine when the main repo creates a branch and opens a PR. (can be seen here: performous/performous#725)

However upon opening a PR from a forked repo branch into the main master (can be seen here: performous/performous#726 getting the error:

pr_comment
This workflow doesn't match any pull requests!

These are the workflows within our master branch: https://github.com/performous/performous/tree/master/.github/workflows

@ooshlablu
Copy link

To add a bit more information:
github.event.workflow_run.pull_requests returns nothing when a PR is created from a fork, but returns everything you would expect when a PR is made internally to the repo. Unfortunately, I don't think there is really anything that can be done at the moment. This is either a bug in GitHub Actions or unsupported activity.
I have found a workaround using the issues search API. I will post a PR with my updates in a little while.

@oprypin
Copy link
Owner

oprypin commented Apr 22, 2022

Seeing as your PR changes to search API and this commit seems to change away from search API 99348f4
-perhaps it's enough to revert it.
Could you please try the old version of the script and see if that works just as well as in your PR?

@oprypin oprypin linked a pull request Apr 22, 2022 that will close this issue
@oprypin
Copy link
Owner

oprypin commented Apr 22, 2022

Forgot to post the actual old version of the script that I mention. Here it is. https://github.com/oprypin/nightly.link/blob/4e83d1452dd1bf350ebe1a3910e395e6cf447fdf/.github/workflows/pr-comment.yml

@ooshlablu
Copy link

I tried the old version in my repo https://github.com/ooshlablu/performous
It failed with the error: No matching pull request found

@rfay
Copy link

rfay commented May 5, 2022

I certainly am having this problem. Can it have anything to do with the recent update of actions/github-script to v6?

@oprypin
Copy link
Owner

oprypin commented May 5, 2022

@rfay
Copy link

rfay commented May 5, 2022

Here's the version you suggest, working fine with a PR:

https://github.com/drud/junk-test-pr-comment/pull/2

@oprypin
Copy link
Owner

oprypin commented May 5, 2022

OK so in the meantime you can simply use that if it works better. There's no requirement that the script currently merged in the main branch here needs to be used, there are no permanent references to it.
I don't know when I'll get around to considering this issue.

@rfay
Copy link

rfay commented May 5, 2022

In the test repo I did try out the new/current version just to verify; it fails as described here. But the old version, https://github.com/oprypin/nightly.link/blob/4e83d1452dd1bf350ebe1a3910e395e6cf447fdf/.github/workflows/pr-comment.yml works OK.

@white-gecko
Copy link

For me, just reverting to https://github.com/oprypin/nightly.link/blob/4e83d1452dd1bf350ebe1a3910e395e6cf447fdf/.github/workflows/pr-comment.yml did not work, I got:

…
TypeError: Cannot read properties of undefined (reading 'list')
Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'list')
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:8:36)
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:16:3)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15144:12)
    at main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15236:26)
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15217:1
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15268:3
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15271:12)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)

did anyone find a stable solution that works with the current API?

@white-gecko
Copy link

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 a pull request may close this issue.

5 participants