95a66532d17181693b828bda95f4261e5421b409

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

chore: use GITHUB_TOKEN auth for Project Beta GitHub Action

Diff

 1diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml
 2index ba3e115c931b4bf73ed9c171e2f7e2c123644492..2b3cc732fc8f0bb3783895e8d7b60fd5d03eba1f 100644
 3--- a/.github/workflows/project.yml
 4+++ b/.github/workflows/project.yml
 5@@ -10,15 +10,9 @@ jobs:
 6     name: Add to project
 7     runs-on: ubuntu-latest
 8     steps:
 9-      - name: Generate token
10-        id: generate_token
11-        uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
12-        with:
13-          app_id: ${{ secrets.OHMYZSH_BOT_APP_ID }}
14-          private_key: ${{ secrets.OHMYZSH_BOT_APP_PEM }}
15       - name: Read project data
16         env:
17-          GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
18+          GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}
19           ORGANIZATION: ohmyzsh
20           PROJECT_NUMBER: "1"
21         run: |
22@@ -45,9 +39,10 @@ jobs:
23           PLUGIN_FIELD_ID=$(jq '.data.organization.projectNext.fields.nodes[] | select(.name == "Plugin") | .id' project_data.json)
24           THEME_FIELD_ID=$(jq '.data.organization.projectNext.fields.nodes[] | select(.name == "Theme") | .id' project_data.json)
25           EOF
26+
27       - name: Add to project
28         env:
29-          GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
30+          GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}
31           ISSUE_ID: ${{ github.event.issue.node_id }}
32           PR_ID: ${{ github.event.pull_request.node_id }}
33         run: |
34@@ -62,10 +57,11 @@ jobs:
35           ' -f project=$PROJECT_ID -f item=${ISSUE_ID:-$PR_ID} --jq '.data.addProjectNextItem.projectNextItem.id')"
36 
37           echo "ITEM_ID=$item_id" >> $GITHUB_ENV
38+
39       - name: Classify Pull Request
40         if: github.event_name == 'pull_request_target'
41         env:
42-          GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
43+          GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}
44         run: |
45           gh pr view ${{ github.event.pull_request.number }} --json files --jq '.files.[].path' | awk -F/ '
46             /^plugins\// {
47@@ -92,10 +88,11 @@ jobs:
48           if [[ $(wc -l < themes.list) = 1 ]]; then
49             echo "THEME=$(cat themes.list)" >> $GITHUB_ENV
50           fi
51+
52       - name: Fill Pull Request fields in project
53         if: github.event_name == 'pull_request_target'
54         env:
55-          GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
56+          GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}
57         run: |
58           gh api graphql -f query='
59             mutation (