Skip to content

Commit

Permalink
feat: secret
Browse files Browse the repository at this point in the history
  • Loading branch information
itsyoboieltr committed Aug 2, 2024
1 parent a07ad61 commit 7a15553
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/add-team-label-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ on:
jobs:
add-team-label:
uses: ./.github/workflows/add-team-label.yml
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.LABEL_TOKEN }}
11 changes: 5 additions & 6 deletions .github/workflows/add-team-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')"
Expand All @@ -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?"

0 comments on commit 7a15553

Please sign in to comment.