From 7708e007fc11aeba99bac869ca3345dc40a474ff Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 9 Dec 2025 11:37:39 +0100 Subject: [PATCH 1/2] chore(ci): Fix double issue creation for unreferenced PRs --- .github/workflows/create-issue-for-unreferenced-prs.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-issue-for-unreferenced-prs.yml b/.github/workflows/create-issue-for-unreferenced-prs.yml index a0eee060f282..d8a1412ed4f6 100644 --- a/.github/workflows/create-issue-for-unreferenced-prs.yml +++ b/.github/workflows/create-issue-for-unreferenced-prs.yml @@ -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, @@ -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, From 4c8d83ff5da075ef0dc7b49c2661f2bf532b4b22 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 9 Dec 2025 11:42:06 +0100 Subject: [PATCH 2/2] make check more specific --- .github/workflows/create-issue-for-unreferenced-prs.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-issue-for-unreferenced-prs.yml b/.github/workflows/create-issue-for-unreferenced-prs.yml index d8a1412ed4f6..a47df32738d7 100644 --- a/.github/workflows/create-issue-for-unreferenced-prs.yml +++ b/.github/workflows/create-issue-for-unreferenced-prs.yml @@ -41,10 +41,11 @@ jobs: return; } - // Bail if this edit was made by the GitHub Actions bot + // Bail if this edit was made by the GitHub Actions bot (this workflow) // 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.`); + // We check login specifically to not skip edits from other legitimate bots + if (context.payload.sender && context.payload.sender.login === 'github-actions[bot]') { + console.log(`PR #${pr.number} was edited by github-actions[bot] (this workflow), skipping.`); return; }