Modify PR workflow to remove multiple labels

Removes work in progress label too.
This commit is contained in:
Igor
2025-09-14 13:09:23 +02:00
parent cc52a1e53f
commit 3bb8125be8

View File

@@ -35,19 +35,20 @@ jobs:
comment: '✅ This PR has been reviewed and approved — all set for merge!'
pullRequestNumber: ${{ steps.pr.outputs.number }}
- name: Remove "Needs review" label
- name: Remove review-related labels
if: ${{ success() }}
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const issue_number = ${{ steps.pr.outputs.number }};
try {
await github.rest.issues.removeLabel({
owner, repo, issue_number,
name: "Needs review"
});
core.info('Removed label "Needs review"');
} catch (e) {
core.warning(`Could not remove label: ${e.message}`);
const labelsToRemove = ["Needs review", "Work in progress"];
for (const name of labelsToRemove) {
try {
await github.rest.issues.removeLabel({ owner, repo, issue_number, name });
core.info(`Removed label "${name}"`);
} catch (e) {
core.warning(`Could not remove label "${name}": ${e.message}`);
}
}