Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .github/workflows/create-issue-for-unreferenced-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ jobs:
return;
}

// Bail if this edit was made by the GitHub Actions bot
// This prevents infinite loops when we update the PR body with the new issue reference
if (context.payload.sender && context.payload.sender.type === 'Bot') {
console.log(`PR #${pr.number} was edited by a bot (likely this action), skipping.`);
return;
}

// Check if the PR is already approved
const reviewsResponse = await github.rest.pulls.listReviews({
owner: context.repo.owner,
Expand Down Expand Up @@ -109,7 +116,7 @@ jobs:
console.log(`Created issue #${issueID}.`);

// Update the PR body to reference the new issue
const updatedPrBody = `${prBody}\n\nCloses #${issueID}`;
const updatedPrBody = `${prBody}\n\nCloses #${issueID} (added automatically)`;

await github.rest.pulls.update({
owner: context.repo.owner,
Expand Down
Loading