Skip to content

Commit 2ec1065

Browse files
committed
fix: use search API for issue dedup to handle large repos
1 parent d8fc802 commit 2ec1065

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

.github/workflows/ci-failure-issue.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,11 @@ jobs:
3636
const branch = context.payload.workflow_run.head_branch;
3737
const title = `CI Failure: ${workflowName}`;
3838
39-
const { data: issues } = await github.rest.issues.listForRepo({
40-
owner: context.repo.owner,
41-
repo: context.repo.repo,
42-
labels: 'high-severity,ci',
43-
state: 'open',
44-
per_page: 100
39+
const { data } = await github.rest.search.issuesAndPullRequests({
40+
q: `repo:${context.repo.owner}/${context.repo.repo} is:issue is:open in:title "${title}"`
4541
});
4642
47-
if (issues.some(i => i.title === title)) {
43+
if (data.items.some(i => i.title === title)) {
4844
core.info(`Issue already exists for "${title}"`);
4945
return;
5046
}

0 commit comments

Comments
 (0)