diff --git a/.github/workflows/add-new-team-label.yml b/.github/workflows/add-new-team-label.yml new file mode 100644 index 0000000000..e9f103045b --- /dev/null +++ b/.github/workflows/add-new-team-label.yml @@ -0,0 +1,18 @@ +name: "Label new issues with needs-team" + +on: + issues: + types: [opened] + +jobs: + add-needs-triage-label: + name: Add `needs-team` label + runs-on: ubuntu-latest + steps: + - name: Add the needs-team label + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: | + needs-team + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/add-to-board.yml b/.github/workflows/add-to-board.yml new file mode 100644 index 0000000000..1619a13315 --- /dev/null +++ b/.github/workflows/add-to-board.yml @@ -0,0 +1,46 @@ +name: Triage & route issues + +on: + issues: + types: [labeled] + +permissions: + issues: write + contents: read + +jobs: + route: + runs-on: ubuntu-latest + if: > + contains( + [ + 'team:Obs', + 'team:Security', + 'team:Platform', + 'team:DocsEng', + 'team:Projects' + ], + github.event.label.name + ) + env: + PROJECT_ID_MAP: | + { + "team:Obs": "649", + "team:Security": "1034", + "team:Platform": "1232", + "team:DocsEng": "1625", + "team:Projects": "1415" + } + steps: + - name: Remove needs-team label + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: needs-team + + - name: Add issue to the right project + uses: actions/add-to-project@v1 + with: + project-url: https://github.com/orgs/elastic/projects/${{ fromJson(env.PROJECT_ID_MAP)[github.event.label.name] }} + github-token: ${{ secrets.ADD_TO_BOARD_TOKEN }} + labeled: ${{ github.event.label.name }} + label-operator: OR