From 1829f2d2a59d739244716525ac7bb0bf6bdc19a1 Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Aug 2023 16:00:05 +0100 Subject: [PATCH 1/2] Add a Github Action that removes the "needs reporter action" label when the issue or PR has been commented on --- .github/workflows/unlabel.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/unlabel.yml diff --git a/.github/workflows/unlabel.yml b/.github/workflows/unlabel.yml new file mode 100644 index 00000000000..4e2a7dd5768 --- /dev/null +++ b/.github/workflows/unlabel.yml @@ -0,0 +1,11 @@ +name: Remove Label +on: + issue_comment: + types: [created] +jobs: + remove_label: + runs-on: ubuntu-latest + steps: + - uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: "needs reporter action" From 98ce196d7674d2f2661653ad9ba4745e20d13267 Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 16 Aug 2023 20:33:29 +0100 Subject: [PATCH 2/2] [github action] Only run the action if the comment comes from a non-maintainer and the issue has the appropriate label --- .github/workflows/unlabel.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unlabel.yml b/.github/workflows/unlabel.yml index 4e2a7dd5768..c110dea88ac 100644 --- a/.github/workflows/unlabel.yml +++ b/.github/workflows/unlabel.yml @@ -4,8 +4,9 @@ on: types: [created] jobs: remove_label: + if: ${{ !contains(fromJSON(vars.MAINTAINERS), github.event.comment.user.login) && contains(github.event.issue.labels.*.name, fromJSON(vars.LABEL_TO_REMOVE)) }} runs-on: ubuntu-latest steps: - uses: actions-ecosystem/action-remove-labels@v1 with: - labels: "needs reporter action" + labels: ${{ fromJSON(vars.LABEL_TO_REMOVE) }}