From ddff93fbf87a58c3d9a5002372c6f5752cf7c756 Mon Sep 17 00:00:00 2001 From: Jason Tang Date: Thu, 27 Feb 2025 07:31:55 -0500 Subject: [PATCH] Only allow Owner and Member to trigger workflow via PR comment. Signed-off-by: Jason Tang --- .github/workflows/uptest-trigger.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uptest-trigger.yaml b/.github/workflows/uptest-trigger.yaml index a99abc2..b229f4e 100644 --- a/.github/workflows/uptest-trigger.yaml +++ b/.github/workflows/uptest-trigger.yaml @@ -22,7 +22,7 @@ jobs: echo "github.event.comment.author_association: ${{ github.event.comment.author_association }}" get-example-list: - if: ${{ (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' ) && + if: ${{ (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' ) && github.event.issue.pull_request && contains(github.event.comment.body, '/test-examples' ) }} runs-on: ubuntu-latest @@ -79,7 +79,7 @@ jobs: -f context="Uptest-${{ steps.get-example-list-name.outputs.example-hash }}" uptest: - if: ${{ (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' ) && + if: ${{ (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' ) && github.event.issue.pull_request && contains(github.event.comment.body, '/test-examples' ) }} runs-on: ubuntu-latest