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,