fix: keep issues open on contributor approval fixes #3214

This commit is contained in:
Mario Zechner
2026-04-15 16:13:00 +02:00
parent 41b44cad24
commit c2c185a5e6

View File

@@ -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',
});