From 3b9a6c515c32f3593768c14fb8a9c5f4475fecb0 Mon Sep 17 00:00:00 2001 From: "John L. Singleton" Date: Thu, 23 Mar 2023 15:56:50 -0400 Subject: [PATCH 1/2] quiet down matrix testing --- .github/workflows/dispatch-matrix-check.yml | 2 +- .../dispatch-matrix-test-on-comment.yml | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dispatch-matrix-test-on-comment.yml diff --git a/.github/workflows/dispatch-matrix-check.yml b/.github/workflows/dispatch-matrix-check.yml index 09e23b425f..a1cf8606a1 100644 --- a/.github/workflows/dispatch-matrix-check.yml +++ b/.github/workflows/dispatch-matrix-check.yml @@ -4,7 +4,7 @@ on: pull_request_target: types: [synchronize,opened] branches: - - "**" + - "matrix/**" workflow_dispatch: jobs: diff --git a/.github/workflows/dispatch-matrix-test-on-comment.yml b/.github/workflows/dispatch-matrix-test-on-comment.yml new file mode 100644 index 0000000000..654cc6c980 --- /dev/null +++ b/.github/workflows/dispatch-matrix-test-on-comment.yml @@ -0,0 +1,47 @@ +name: 🤖 Run Matrix Check (On Comment) + +on: + issue_comment: + types: [created] + branches: + - main + - "rc/**" + - next + +jobs: + dispatch-matrix-check: + 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 Matrix Testing Job + if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') }} + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }} + repository: github/codeql-coding-standards-release-engineering + event-type: matrix-test + client-payload: '{"pr": "${{ github.event.number }}"}' + + - uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results.

:bulb: If you do not hear back from me please check my status! **I will report even if this PR does not contain files eligible for matrix testing.**' + }) \ No newline at end of file From c5ef34afe9e24a27c5413d1bb2f599dad83e7235 Mon Sep 17 00:00:00 2001 From: "John L. Singleton" Date: Thu, 23 Mar 2023 16:03:18 -0400 Subject: [PATCH 2/2] doesn't need to be on any particular merge branch --- .github/workflows/dispatch-matrix-test-on-comment.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/dispatch-matrix-test-on-comment.yml b/.github/workflows/dispatch-matrix-test-on-comment.yml index 654cc6c980..9f8e77edaa 100644 --- a/.github/workflows/dispatch-matrix-test-on-comment.yml +++ b/.github/workflows/dispatch-matrix-test-on-comment.yml @@ -3,10 +3,6 @@ name: 🤖 Run Matrix Check (On Comment) on: issue_comment: types: [created] - branches: - - main - - "rc/**" - - next jobs: dispatch-matrix-check: @@ -26,7 +22,7 @@ jobs: throw "Refusing to run workflow for user not in acl." } - + - name: Dispatch Matrix Testing Job if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') }} uses: peter-evans/repository-dispatch@v2