From 7a15553c1701548a7ce30285927945d2269878f2 Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:49:49 +0200 Subject: [PATCH] feat: secret --- .github/workflows/add-team-label-test.yml | 2 ++ .github/workflows/add-team-label.yml | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/add-team-label-test.yml b/.github/workflows/add-team-label-test.yml index c15bba2..7649608 100644 --- a/.github/workflows/add-team-label-test.yml +++ b/.github/workflows/add-team-label-test.yml @@ -10,3 +10,5 @@ on: jobs: add-team-label: uses: ./.github/workflows/add-team-label.yml + secrets: + PERSONAL_ACCESS_TOKEN: ${{ secrets.LABEL_TOKEN }} diff --git a/.github/workflows/add-team-label.yml b/.github/workflows/add-team-label.yml index d48828c..3de6fe9 100644 --- a/.github/workflows/add-team-label.yml +++ b/.github/workflows/add-team-label.yml @@ -2,18 +2,18 @@ name: Add team label on: workflow_call: + secrets: + PERSONAL_ACCESS_TOKEN: + required: true jobs: add-team-label: runs-on: ubuntu-latest steps: - - name: Test label token - run: echo "${{ secrets.LABEL_TOKEN }}" - - name: Get team label id: get-team-label env: - GH_TOKEN: ${{ secrets.LABEL_TOKEN }} + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} USER: ${{ github.event.pull_request.user.login }} run: | team_label="$(gh api -H 'Accept: application/vnd.github.raw' 'repos/metamask/metamask-planning/contents/teams.json' --jq '.$USER')" @@ -25,9 +25,8 @@ jobs: - name: Add team label env: - GH_TOKEN: ${{ secrets.LABEL_TOKEN }} + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} PULL_REQUEST_NUMBER: ${{ github.event.number }} TEAM_LABEL: ${{ steps.get-team-label.outputs.TEAM_LABEL }} run: | gh pr edit $PULL_REQUEST_NUMBER --add-label $TEAM_LABEL - echo "Why is this not working?"