Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/create-issue-for-unreferenced-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ jobs:
return;
}

// Check if there's already an issue created by this automation for this PR
// Search for issues that mention this PR and were created by github-actions bot
const existingIssuesResponse = await github.rest.search.issuesAndPullRequests({
q: `repo:${context.repo.owner}/${context.repo.repo} is:issue is:open "${prUrl}" author:app/github-actions in:body`,
});

if (existingIssuesResponse.data.total_count > 0) {
const existingIssue = existingIssuesResponse.data.items[0];
console.log(`An issue (#${existingIssue.number}) already exists for PR #${prNumber}, skipping creation.`);
return;
}

core.warning(`PR #${prNumber} does not have an issue reference. Creating a new issue so it can be tracked in Linear.`);

// Construct the title and body for the new issue
Expand Down
Loading