From de96fc90a629bdeb93f96a9d4307361f3e52be62 Mon Sep 17 00:00:00 2001 From: Migara Ekanayake <2110772+migara@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:14:43 +0100 Subject: [PATCH] ci: Use a GitHub App for chatops token (#316) Co-authored-by: Sebastian Czech --- .github/workflows/chatops.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chatops.yml b/.github/workflows/chatops.yml index fa96c073..86901201 100644 --- a/.github/workflows/chatops.yml +++ b/.github/workflows/chatops.yml @@ -33,12 +33,21 @@ jobs: }) console.log(pr.data.head.ref) return pr.data.head.ref - + + - name: Generate GitHub token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.CHATOPS_APP_ID }} + private_key: ${{ secrets.CHATOPS_APP_PRIVATE_KEY }} + installation_retrieval_mode: id + installation_retrieval_payload: ${{ secrets.CHATOPS_APP_INSTALLATION_ID }} + - name: "dispatch test command on branch: ${{ steps.pr.outputs.result }}" id: scd uses: peter-evans/slash-command-dispatch@v3 with: - token: ${{ secrets.CHATOPS }} + token: ${{ steps.generate-token.outputs.token }} issue-type: pull-request dispatch-type: workflow permission: maintain @@ -74,4 +83,4 @@ jobs: > ChatOPS run cancelled. > See [job run log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details. reactions: 'confused' - reactions-edit-mode: replace \ No newline at end of file + reactions-edit-mode: replace