diff --git a/.github/workflows/dispatch-matrix-check.yml b/.github/workflows/dispatch-matrix-check.yml index 7da92294c2..09e23b425f 100644 --- a/.github/workflows/dispatch-matrix-check.yml +++ b/.github/workflows/dispatch-matrix-check.yml @@ -1,7 +1,8 @@ name: 🤖 Run Matrix Check on: - pull_request: + pull_request_target: + types: [synchronize,opened] branches: - "**" workflow_dispatch: @@ -11,7 +12,13 @@ jobs: runs-on: ubuntu-latest steps: + - name: Test Variables + shell: pwsh + run: | + Write-Host "Running as: ${{github.actor}}" + - name: Dispatch Matrix Testing Job + if: ${{ contains(fromJSON('["jsinglet", "mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine"]'), github.actor) }} uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }} @@ -21,6 +28,7 @@ jobs: - uses: actions/github-script@v6 + if: ${{ contains(fromJSON('["jsinglet", "mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine"]'), github.actor) }} with: script: | github.rest.issues.createComment({ diff --git a/.github/workflows/dispatch-release-performance-check.yml b/.github/workflows/dispatch-release-performance-check.yml index 05ef63c103..abba5328bd 100644 --- a/.github/workflows/dispatch-release-performance-check.yml +++ b/.github/workflows/dispatch-release-performance-check.yml @@ -13,6 +13,19 @@ jobs: runs-on: ubuntu-latest steps: + - name: Test Variables + shell: pwsh + run: | + Write-Host "Running as: ${{github.actor}}" + + $actor = "${{github.actor}}" + + $acl = @("jsinglet","mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine") + + if(-not ($actor -in $acl)){ + throw "Refusing to run workflow for user not in acl." + } + - name: Dispatch Performance Testing Job if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') }} uses: peter-evans/repository-dispatch@v2 @@ -20,7 +33,7 @@ jobs: token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }} repository: github/codeql-coding-standards-release-engineering event-type: performance-test - client-payload: '{"pr": "${{ github.event.number }}"}' + client-payload: '{"pr": "${{ github.event.issue.number }}"}' - uses: actions/github-script@v6