Skip to content

Commit

Permalink
fix(ci): chat bot from safe fork
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroqn committed May 30, 2022
1 parent 79ef129 commit e1a0cc0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Dispatch integration test from PR
on:
issue_comment:
types: [created]
pull_request:
pull_request_target:
types: [opened, synchronize]

jobs:
Expand Down Expand Up @@ -63,14 +63,23 @@ jobs:
if: github.event.pull_request
runs-on: ubuntu-latest
steps:
- name: Query author repository permissions
uses: octokit/request-action@v2.x
id: user_permission
with:
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}/permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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 }}

- name: Dispatch from pull request
- name: Dispatch from pull request if user does have correct permission
if: contains('admin write', fromJson(steps.user_permission.outputs.data).permission)
uses: actions/github-script@v6
id: dispatch
with:
Expand Down

0 comments on commit e1a0cc0

Please sign in to comment.