From d8357342a3a6423c561d01e4ed9ca54c9360090b Mon Sep 17 00:00:00 2001 From: Armand Grillet <2117580+armandgrillet@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:25:01 +0200 Subject: [PATCH] Fix issue-labeled GitHub Action using app permissions (#76114) --- .github/workflows/issue-labeled.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index de4d9b0000f..1f249169f4d 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -62,6 +62,14 @@ jobs: replace-with: "'" flags: 'g' + - name: Get Token + id: get_workflow_token + uses: peter-murray/workflow-application-token-action@v2 + with: + application_id: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_ID }} + application_private_key: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_KEY }} + organization: grafana + - name: "Check that issue author is not part of the team" if: ${{ env.TEAM != 'null' }} run: | @@ -75,7 +83,7 @@ jobs: echo "USER_FOUND=maybe" >> $GITHUB_ENV fi env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} - name: "Send Slack notification" if: ${{ (env.CHANNEL != 'null') && ((env.USER_FOUND == 'false') || (env.TEAM != 'null')) }}