From a079df54393a61b84f7eed3f359fdaba9bd3f3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Tue, 15 Mar 2022 17:08:28 +0100 Subject: [PATCH] feat: auto label issues based on service(s) selected Close https://github.com/jenkins-infra/helpdesk/issues/12 --- .github/workflows/autolabels.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/autolabels.yaml diff --git a/.github/workflows/autolabels.yaml b/.github/workflows/autolabels.yaml new file mode 100644 index 0000000..9ada14e --- /dev/null +++ b/.github/workflows/autolabels.yaml @@ -0,0 +1,18 @@ +name: Autolabeler +on: + issues: + types: [opened, edited] +jobs: + autolabeler: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: stefanbuck/github-issue-praser@v2 + id: issue-parser + with: + template-path: .github/ISSUE_TEMPLATE/1-report-issue.yml + - run: echo "ISSUE_LABELS=$(echo '${{ steps.issue-parser.outputs.jsonString }}' | jq '.services' | tr '[:upper:]' '[:lower:]' | sed 's/"//g' | sed 's/ //g')" >> $GITHUB_ENV + - uses: andymckay/labeler@master + with: + add-labels: ${{ env.ISSUE_LABELS }} + remove-labels: "other"