From eb3f64b3f8030f757e9b0a90cc99999db6e5fdbc Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Wed, 18 Sep 2024 10:09:53 +0200 Subject: [PATCH] Chore: Fix issue-labeled workflow permission errors (#93417) * Chore: Fix issue-labeled workflow permission errors * fix comparison --- .github/workflows/issue-labeled.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 8cc4f303c8b..09513a7d5cc 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -49,8 +49,8 @@ jobs: fi # set environment for next steps - echo "CHANNEL=${CHANNEL}" >> $GITHUB_ENV - echo "TEAM=${TEAM}" >> $GITHUB_ENV + echo "CHANNEL=${CHANNEL}" >> "$GITHUB_ENV" + echo "TEAM=${TEAM}" >> "$GITHUB_ENV" - name: "Prepare payload" uses: frabert/replace-string-action@v2.5 @@ -64,22 +64,22 @@ jobs: - name: Get Token id: get_workflow_token - uses: peter-murray/workflow-application-token-action@v3 + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a with: - application_id: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_ID }} - application_private_key: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_KEY }} + app_id: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_ID }} + private_key: ${{ secrets.APP_GRAFANA_TEAM_CHECKER_KEY }} - name: "Check that issue author is not part of the team" if: ${{ env.TEAM != 'null' }} run: | response=$(gh api /orgs/grafana/teams/${{ env.TEAM }}/memberships/${{ github.event.issue.user.login }} -i -H "Accept: application/vnd.github.v3+json") STATUS_CODE=$(echo "$response" | head -n 1 | cut -d' ' -f2) - if [ "$status_code" -eq 404 ]; then + if [ "$STATUS_CODE" -eq "404" ]; then echo "The user was not found in the team." - echo "USER_FOUND=false" >> $GITHUB_ENV + echo "USER_FOUND=false" >> "$GITHUB_ENV" else echo "The user was potentially found in the team" - echo "USER_FOUND=maybe" >> $GITHUB_ENV + echo "USER_FOUND=maybe" >> "$GITHUB_ENV" fi env: GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}