From ce30ae780317b64d93e3f135a4171aaf75059e2d Mon Sep 17 00:00:00 2001 From: neuronull Date: Mon, 23 Oct 2023 16:04:58 -0600 Subject: [PATCH 1/2] chore(ci): filter team members from gardener issue comment workflow --- .github/workflows/gardener_issue_comment.yml | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gardener_issue_comment.yml b/.github/workflows/gardener_issue_comment.yml index f25dc9da5e02a..1f98ca7ada2e3 100644 --- a/.github/workflows/gardener_issue_comment.yml +++ b/.github/workflows/gardener_issue_comment.yml @@ -1,7 +1,8 @@ # Gardener Issue Comment # # This workflow moves GH issues from the Gardener board's "Blocked / Waiting" column -# to the "Triage", so that the Gardener can assess the issue in light of new information. +# to "Triage", when a comment is posted on an issue from a non-team member +# so that the Gardener can assess the issue in light of new information. name: Gardener Issue Comment @@ -15,6 +16,25 @@ jobs: runs-on: ubuntu-latest if: contains(github.event.issue.url, 'issues') steps: + - name: Generate authentication token + id: generate_token + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a + with: + app_id: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_ID }} + private_key: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_PRIVATE_KEY }} + + - name: Get PR comment author + id: comment + uses: tspascoal/get-user-teams-membership@v3 + with: + username: ${{ github.actor }} + team: 'Vector' + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + + - name: Exit if author is team member + if: steps.comment.outputs.isTeamMember == 'true' + run: exit 0 + - name: Move issue back to Triage if status is Blocked/Waiting env: GH_TOKEN: ${{ secrets.GH_PROJECT_PAT }} From 37f56ced4fb0f3ff605873cf0b56ada959f08926 Mon Sep 17 00:00:00 2001 From: neuronull Date: Mon, 23 Oct 2023 16:24:53 -0600 Subject: [PATCH 2/2] fix logic --- .github/workflows/gardener_issue_comment.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/gardener_issue_comment.yml b/.github/workflows/gardener_issue_comment.yml index 1f98ca7ada2e3..b55221ef32a42 100644 --- a/.github/workflows/gardener_issue_comment.yml +++ b/.github/workflows/gardener_issue_comment.yml @@ -31,11 +31,8 @@ jobs: team: 'Vector' GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} - - name: Exit if author is team member - if: steps.comment.outputs.isTeamMember == 'true' - run: exit 0 - - name: Move issue back to Triage if status is Blocked/Waiting + if: steps.comment.outputs.isTeamMember == 'false' env: GH_TOKEN: ${{ secrets.GH_PROJECT_PAT }} run: |