From: Daan De Meyer Date: Tue, 10 Jan 2023 12:16:33 +0000 (+0100) Subject: ci: Remove a bunch of labels when a PR is merged X-Git-Tag: v253-rc1~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81315baa68c9c8f7f6f5608fa8bc1daebf0618df;p=thirdparty%2Fsystemd.git ci: Remove a bunch of labels when a PR is merged --- diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index c3b4040add3..400e8c6fb62 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -6,7 +6,7 @@ name: "Pull Request Labeler" on: pull_request_target: - types: [opened, synchronize, reopened, ready_for_review] + types: [opened, synchronize, reopened, ready_for_review, closed] issue_comment: types: [created] @@ -81,3 +81,34 @@ jobs: repo: context.repo.repo, labels: ["please-review"] }) + + - uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 + if: github.event_name == 'pull_request_target' && github.event.issue.pull_request && github.event.pull_request.merged == true + with: + script: | + for (const label of ["please-review", + "reviewed/needs-rework 🔨", + "ci-fails/needs-rework 🔥", + "needs-rebase", + "good-to-merge/waiting-for-ci 👍", + "good-to-merge/after-next-release", + "good-to-merge/with-minor-suggestions", + "good-to-merge/waiting-for-reporter-feedback 👍", + "needs-discussion 🤔", + "needs-reporter-feedback ❓", + "dont-merge", + "squash-on-merge, + "quick-review"]) { + try { + await github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: label, + }); + } catch (err) { + if (err.status != 404) { + throw err; + } + } + }