From e55be606425eb3c5e281bd67631515598ee7a488 Mon Sep 17 00:00:00 2001 From: ZHOU Date: Tue, 19 Nov 2024 10:35:50 +0800 Subject: [PATCH] Update github.js --- .github/workflows/github.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github.js b/.github/workflows/github.js index bb75ebd..d926eb1 100644 --- a/.github/workflows/github.js +++ b/.github/workflows/github.js @@ -10,13 +10,12 @@ async function getOrCreateIssue(milestone) { try { const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); - const response = await octokit.paginate(octokit.rest.issues.listForRepo, { + const issues = await octokit.paginate(octokit.rest.issues.listForRepo, { owner, repo, milestone: milestone.number, }); - console.info('[octokit.rest.issues.listForRepo]', response); - const { data: issues } = response + let hash = '#' + milestone.number let issue = issues.find((issue) => issue.title.includes(milestone.title)); issue = issues.find((issue) => issue.title.includes(hash)); @@ -68,7 +67,7 @@ async function updateIterationPlan(issue, milestone) { console.info(`Updating milestone plan: ${milestone.title} `) const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); - const { data: issues } = await octokit.paginate('GET /repos/{owner}/{repo}/issues', { + const issues = await octokit.paginate(octokit.rest.issues.listForRepo, { owner, repo, milestone: milestone.number,