From 8e35fb46c43c5f8d154ba400933d8c22f8e3fe5e Mon Sep 17 00:00:00 2001 From: bmorelli25 Date: Wed, 16 Apr 2025 15:28:25 -0700 Subject: [PATCH 1/4] Add issue automation --- .github/workflows/add-to-board.yml | 47 ++++++++++++++++++++++++++ .github/workflows/add-triage-label.yml | 18 ++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/add-to-board.yml create mode 100644 .github/workflows/add-triage-label.yml diff --git a/.github/workflows/add-to-board.yml b/.github/workflows/add-to-board.yml new file mode 100644 index 0000000000..63bdc11e56 --- /dev/null +++ b/.github/workflows/add-to-board.yml @@ -0,0 +1,47 @@ +name: Triage & route issues + +on: + issues: + types: [labeled] + +permissions: + issues: write + contents: read + projects: write + +jobs: + route: + runs-on: ubuntu-latest + if: > + contains( + [ + 'team:obs', + 'team:security', + 'team:platform', + 'team:docs-eng', + 'team:docs-projects' + ], + github.event.label.name + ) + env: + PROJECT_ID_MAP: | + { + "team:obs": "649", + "team:security": "1034", + "team:platform": "1232", + "team:docs-eng": "1625", + "team:docs-projects": "1415" + } + steps: + - name: Remove needs‑triage label + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: needs-triage + + - 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.TRIAGE_TOKEN }} + labeled: ${{ github.event.label.name }} + label-operator: OR diff --git a/.github/workflows/add-triage-label.yml b/.github/workflows/add-triage-label.yml new file mode 100644 index 0000000000..4345d6638d --- /dev/null +++ b/.github/workflows/add-triage-label.yml @@ -0,0 +1,18 @@ +name: "Label new issues for triage" + +on: + issues: + types: [opened] + +jobs: + add-needs-triage-label: + name: Add `triage` label + runs-on: ubuntu-latest + steps: + - name: Add the triage label + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: | + triage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 48eb632df90d7170453b8cc7fd738206cb76622c Mon Sep 17 00:00:00 2001 From: bmorelli25 Date: Wed, 16 Apr 2025 15:34:24 -0700 Subject: [PATCH 2/4] upd team labels --- .github/workflows/add-to-board.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/add-to-board.yml b/.github/workflows/add-to-board.yml index 63bdc11e56..7e3f1dcb33 100644 --- a/.github/workflows/add-to-board.yml +++ b/.github/workflows/add-to-board.yml @@ -26,11 +26,11 @@ jobs: env: PROJECT_ID_MAP: | { - "team:obs": "649", - "team:security": "1034", - "team:platform": "1232", - "team:docs-eng": "1625", - "team:docs-projects": "1415" + "team:Obs": "649", + "team:Security": "1034", + "team:Platform": "1232", + "team:DocsEng": "1625", + "team:Pojects": "1415" } steps: - name: Remove needs‑triage label From acef2417adea14d792991eae408f5fad8886979b Mon Sep 17 00:00:00 2001 From: bmorelli25 Date: Wed, 16 Apr 2025 15:34:44 -0700 Subject: [PATCH 3/4] bug --- .github/workflows/add-to-board.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add-to-board.yml b/.github/workflows/add-to-board.yml index 7e3f1dcb33..bbc717d54c 100644 --- a/.github/workflows/add-to-board.yml +++ b/.github/workflows/add-to-board.yml @@ -29,8 +29,8 @@ jobs: "team:Obs": "649", "team:Security": "1034", "team:Platform": "1232", - "team:DocsEng": "1625", - "team:Pojects": "1415" + "team:DocsEng": "1625", + "team:Projects": "1415" } steps: - name: Remove needs‑triage label From c1d7bb91a733a2a3e6cacb418537e62574961a26 Mon Sep 17 00:00:00 2001 From: bmorelli25 Date: Thu, 17 Apr 2025 10:24:49 -0700 Subject: [PATCH 4/4] fixes --- ...riage-label.yml => add-new-team-label.yml} | 8 ++++---- .github/workflows/add-to-board.yml | 19 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) rename .github/workflows/{add-triage-label.yml => add-new-team-label.yml} (65%) diff --git a/.github/workflows/add-triage-label.yml b/.github/workflows/add-new-team-label.yml similarity index 65% rename from .github/workflows/add-triage-label.yml rename to .github/workflows/add-new-team-label.yml index 4345d6638d..e9f103045b 100644 --- a/.github/workflows/add-triage-label.yml +++ b/.github/workflows/add-new-team-label.yml @@ -1,4 +1,4 @@ -name: "Label new issues for triage" +name: "Label new issues with needs-team" on: issues: @@ -6,13 +6,13 @@ on: jobs: add-needs-triage-label: - name: Add `triage` label + name: Add `needs-team` label runs-on: ubuntu-latest steps: - - name: Add the triage label + - name: Add the needs-team label uses: actions-ecosystem/action-add-labels@v1 with: labels: | - triage + needs-team env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/add-to-board.yml b/.github/workflows/add-to-board.yml index bbc717d54c..1619a13315 100644 --- a/.github/workflows/add-to-board.yml +++ b/.github/workflows/add-to-board.yml @@ -7,7 +7,6 @@ on: permissions: issues: write contents: read - projects: write jobs: route: @@ -15,11 +14,11 @@ jobs: if: > contains( [ - 'team:obs', - 'team:security', - 'team:platform', - 'team:docs-eng', - 'team:docs-projects' + 'team:Obs', + 'team:Security', + 'team:Platform', + 'team:DocsEng', + 'team:Projects' ], github.event.label.name ) @@ -30,18 +29,18 @@ jobs: "team:Security": "1034", "team:Platform": "1232", "team:DocsEng": "1625", - "team:Projects": "1415" + "team:Projects": "1415" } steps: - - name: Remove needs‑triage label + - name: Remove needs-team label uses: actions-ecosystem/action-remove-labels@v1 with: - labels: needs-triage + 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.TRIAGE_TOKEN }} + github-token: ${{ secrets.ADD_TO_BOARD_TOKEN }} labeled: ${{ github.event.label.name }} label-operator: OR