Skip to content

Commit

Permalink
chore: add paginator and finalize script
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Jan 17, 2025
1 parent 1e03d35 commit 200b18b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/fix-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ jobs:
uses: actions/github-script@v5
with:
script: |
const { data: issues } = await github.rest.issues.listForRepo({
const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
labels: 'released on @beta',
state: 'all'
});
const issuesWithoutReleasedLabel = issues.filter(issue => !issue.labels.some(label => label.name === 'released'));
console.log('Found %d issues without "released" label', issuesWithoutReleasedLabel.length);
console.log('Issues without "released" label: ', issuesWithoutReleasedLabel.map(issue => '#' + issue.number).join(', '));
core.setOutput('issuesWithoutReleasedLabel', JSON.stringify(issuesWithoutReleasedLabel.map(issue => issue.number)));
Expand All @@ -66,4 +67,10 @@ jobs:
issue_number: issue,
labels: ['released']
});
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue,
name: 'released on @beta'
});
}

0 comments on commit 200b18b

Please sign in to comment.