From 3deaced80876dc4bef7b3527fd305d47b1cb0248 Mon Sep 17 00:00:00 2001 From: Pravin Yogarajah Date: Wed, 11 Dec 2024 21:12:49 +0000 Subject: [PATCH] Limit who can trigger manual workflow --- .github/workflows/validator-script-workflow.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/validator-script-workflow.yml b/.github/workflows/validator-script-workflow.yml index e7199df..80f8f17 100644 --- a/.github/workflows/validator-script-workflow.yml +++ b/.github/workflows/validator-script-workflow.yml @@ -8,5 +8,13 @@ jobs: runs-on: ubuntu-latest # Use the latest Ubuntu image as the runner environment steps: + - name: Check Triggering User + run: | + AUTHORIZED_USERS=("pravin-X109" "ManavShahWasTaken" "donaldknoller") + if [[ ! " ${AUTHORIZED_USERS[@]} " =~ " ${{ github.actor }} " ]]; then + echo "Unauthorized user: ${{ github.actor }}" + exit 1 + fi + - name: Placeholder step run: echo "This is a basic workflow with manual triggering enabled."