feat(ci): use gw-bot token
@@ -7,7 +7,20 @@ on:
types: [opened, synchronize]
jobs:
+ generate-gw-bot-token:
+ runs-on: ubuntu-latest
+ outputs:
+ gw_bot_token: ${{ steps.generate_gw_bot_token.outputs.token }}
+ steps:
+ - name: Generate gw-bot token
+ id: generate_gw_bot_token
+ uses: wow-actions/use-app-token@v1
+ with:
+ app_id: ${{ secrets.GW_BOT_APP_ID }}
+ private_key: ${{ secrets.GW_BOT_PRIVATE_KEY }}
+
from-comment:
+ needs: generate-gw-bot-token
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/itest')
runs-on: ubuntu-latest
steps:
@@ -26,7 +39,7 @@ jobs:
id: dispatch
uses: actions/github-script@v6
with:
- github-token: ${{ secrets.WORKFLOW_DISPATCH_TOKEN }}
+ github-token: ${{ needs.generate-gw-bot-token.outputs.gw_bot_token }}
script: |
const dispatch = {
comment_body: `${{ github.event.comment.body }}`,
@@ -53,6 +66,7 @@ jobs:
core.info(`${JSON.stringify(resp, null, 2)}`);
from-pr:
+ needs: generate-gw-bot-token
if: github.event.pull_request
runs-on: ubuntu-latest
steps:
@@ -60,7 +74,7 @@ jobs:
uses: actions/github-script@v6
id: dispatch
with:
- github-token: ${{ secrets.WORKFLOW_DISPATCH_TOKEN }}
+ github-token: ${{ needs.generate-gw-bot-token.outputs.gw_bot_token }}
script: |
const dispatch = {
comment_body: "",
