From 7562b3b89322bf80cfe46a56e1f4c4b7a6288a1f Mon Sep 17 00:00:00 2001 From: Josh Black Date: Thu, 19 Oct 2023 13:24:06 -0500 Subject: [PATCH] ci: add add-to-inbox workflow --- .github/workflows/add-to-inbox.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/add-to-inbox.yml diff --git a/.github/workflows/add-to-inbox.yml b/.github/workflows/add-to-inbox.yml new file mode 100644 index 00000000..096974da --- /dev/null +++ b/.github/workflows/add-to-inbox.yml @@ -0,0 +1,31 @@ +name: Add to Inbox 📥 +on: + issues: + types: [opened, reopened] + +jobs: + add-to-inbox: + if: ${{ github.repository == 'primer/eslint-plugin-primer-react' }} + env: + ISSUE_URL: ${{ github.event.issue.html_url }} + PROJECT_ID: 4503 + steps: + - id: get-primer-access-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.PRIMER_ISSUE_TRIAGE_APP_ID }} + private-key: ${{ secrets.PRIMER_ISSUE_TRIAGE_APP_PRIVATE_KEY }} + - name: Add react label to issue + run: | + gh issue edit $ISSUE_URL --add-label react + env: + GH_TOKEN: ${{ steps.get-primer-access-token.outputs.token }} + - id: get-github-access-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.PRIMER_ISSUE_TRIAGE_APP_ID_FOR_GITHUB }} + private-key: ${{ secrets.PRIMER_ISSUE_TRIAGE_APP_PRIVATE_KEY_FOR_GITHUB }} + - name: Add issue to project + run: gh project item-add $PROJECT_ID --url $ISSUE_URL --owner github + env: + GH_TOKEN: ${{ steps.get-github-access-token.outputs.token }}