Open Baklap4 opened 2 years ago
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.
Seeing as your PR changes to search API and this commit seems to change away from search API https://github.com/oprypin/nightly.link/commit/99348f45f0bad7dc54bff923a98bd8a901800e6c -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?
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
I tried the old version in my repo https://github.com/ooshlablu/performous
It failed with the error: No matching pull request found
I certainly am having this problem. Can it have anything to do with the recent update of actions/github-script to v6?
You tell me ¯\_(ツ)_/¯ Just try the version before that https://github.com/oprypin/nightly.link/blob/4e83d1452dd1bf350ebe1a3910e395e6cf447fdf/.github/workflows/pr-comment.yml
Here's the version you suggest, working fine with a PR:
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.
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.
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?
This might be a working option: https://github.com/HarbourMasters/Shipwright/blob/071a2d0418d6fb7464a1ddccd2b647683da38eff/.github/workflows/pr-artifacts.yml
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: https://github.com/performous/performous/pull/725)
However upon opening a PR from a forked repo branch into the main master (can be seen here: https://github.com/performous/performous/pull/726)we're getting the error:
These are the workflows within our master branch: https://github.com/performous/performous/tree/master/.github/workflows