Skip to content

Commit a478a2b

Browse files
committed
refactor: remove conditions from searchAPI fallback logic
1 parent 9189ccf commit a478a2b

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/find-sr-issues.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@ export default async (octokit, title, labels, owner, repo) => {
1919
* BACKWARD COMPATIBILITY: Fallback to the search API if the issue was not found in the GraphQL response.
2020
* This fallback will be removed in a future release
2121
*/
22-
if (issueNodes.length === 0) {
23-
try {
24-
const {
25-
data: { items: backwardIssues },
26-
} = await octokit.request("GET /search/issues", {
27-
q: `in:title+repo:${owner}/${repo}+type:issue+state:open+${title}`,
28-
});
29-
issues.push(...backwardIssues);
30-
} catch (error) {
31-
console.log("Error: ", error);
32-
}
22+
try {
23+
const {
24+
data: { items: backwardIssues },
25+
} = await octokit.request("GET /search/issues", {
26+
q: `in:title+repo:${owner}/${repo}+type:issue+state:open+${title}`,
27+
});
28+
issues.push(...backwardIssues);
29+
} catch (error) {
30+
console.log("Error: ", error);
3331
}
3432

3533
return issues.filter((issue) => issue.body && issue.body.includes(ISSUE_ID));

0 commit comments

Comments
 (0)