File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,14 @@ jobs:
58
58
pull_number: pr.number,
59
59
})).data;
60
60
} else {
61
- console.log("PR not found in workflow run");
61
+ const q = `is:pr is:open repo:${context.repo.owner}/${context.repo.repo} sha:${workflowRun.head_sha}`;
62
+ console.log(`PR not found in workflow run, searching for it with ${q}`);
62
63
// PRs sent from forks do not get the pull_requests field set.
63
64
// https://github.com/orgs/community/discussions/25220
64
- pr = (await github.rest.pulls.list({
65
- owner: context.repo.owner,
66
- repo: context.repo.repo,
67
- head: workflowRun.head_sha,
68
- per_page: 1,
69
- })).data[0];
65
+ const response = await github.rest.search.issuesAndPullRequests({ q });
66
+ if (response.data.items.length > 0) {
67
+ pr = response.data.items[0];
68
+ }
70
69
}
71
70
}
72
71
You can’t perform that action at this time.
0 commit comments