From c2c185a5e6f14d467f43347261251f74268bfa1c Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 15 Apr 2026 16:13:00 +0200 Subject: [PATCH] fix: keep issues open on contributor approval fixes #3214 --- .github/workflows/approve-contributor.yml | 26 +++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/approve-contributor.yml b/.github/workflows/approve-contributor.yml index ab041be9..794efad6 100644 --- a/.github/workflows/approve-contributor.yml +++ b/.github/workflows/approve-contributor.yml @@ -96,10 +96,19 @@ jobs: } function stringifyApprovedUsers(entries) { - return `${entries + const normalizedEntries = [...entries]; + + while (normalizedEntries.length > 0) { + const lastEntry = normalizedEntries[normalizedEntries.length - 1]; + if (lastEntry.type !== 'other' || lastEntry.line.trim() !== '') { + break; + } + normalizedEntries.pop(); + } + + return `${normalizedEntries .map((entry) => (entry.type === 'user' ? `${entry.username} ${entry.capability}` : entry.line)) - .join('\n') - .replace(/\n+$/g, '')}\n`; + .join('\n')}\n`; } const content = fs.readFileSync(APPROVED_FILE, 'utf8'); @@ -168,14 +177,3 @@ jobs: body, }); - - name: Close issue after PR approval - if: (steps.update.outputs.status == 'added' || steps.update.outputs.status == 'updated') && steps.update.outputs.capability == 'pr' - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.update({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - state: 'closed', - });