Skip to content

Commit

Permalink
ci: workaround github api bug
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 15, 2023
1 parent f51ec54 commit 2229c5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/scripts/upload-preview.mts
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ async function findPullRequestNumber(octokit: Client): Promise<number> {
* github api 这里有一个 BUG ,
* 如果head 是 `Ayase-252:refactor-e2e` 这种情况就无法正常用 query 进行筛选。
* 所以必须要获取所有的 PR,然后手动筛选
*
*/
const prs = await octokit.paginate('GET /repos/{owner}/{repo}/pulls', {
for await (const { data: prs } of octokit.paginate.iterator('GET /repos/{owner}/{repo}/pulls', {
owner: context.repo.owner,
repo: context.repo.repo,
base: 'master',
state: 'open',
});
for (const pr of prs) {
if (pr.head.label === head) {
return pr.number;
})) {
for (const pr of prs) {
if (pr.head.label === head) {
return pr.number;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-js-env

- run: echo ${{ toJSON(github.event) }}
- run: echo "${{ toJSON(github.event) }}"

- run: npm i -g wrangler

Expand Down

0 comments on commit 2229c5d

Please sign in to comment.