fix: keep issues open on contributor approval fixes #3214
This commit is contained in:
26
.github/workflows/approve-contributor.yml
vendored
26
.github/workflows/approve-contributor.yml
vendored
@@ -96,10 +96,19 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stringifyApprovedUsers(entries) {
|
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))
|
.map((entry) => (entry.type === 'user' ? `${entry.username} ${entry.capability}` : entry.line))
|
||||||
.join('\n')
|
.join('\n')}\n`;
|
||||||
.replace(/\n+$/g, '')}\n`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = fs.readFileSync(APPROVED_FILE, 'utf8');
|
const content = fs.readFileSync(APPROVED_FILE, 'utf8');
|
||||||
@@ -168,14 +177,3 @@ jobs:
|
|||||||
body,
|
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',
|
|
||||||
});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user