From 9b4eb8fb832fd39ded1b9f3be81e37edf1863e34 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Sat, 17 Aug 2024 14:21:31 +0200 Subject: [PATCH] chore(actions): move sec check to action --- .github/workflows/release.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1bba58ae4..68cd1d51ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,20 +14,12 @@ jobs: safety_check: runs-on: ubuntu-latest environment: release - env: - ALLOWED_USER_IDS: ${{ vars.ALLOWED_USER_IDS }} steps: - - name: "Check if Executing User is Allowed" - id: safety - run: | - USER_ID=${{ github.actor_id }} - ALLOWED_IDS=$(echo $ALLOWED_USER_IDS | tr "," "\n") - if echo "$ALLOWED_IDS" | grep -q -w "$USER_ID"; then - echo "User $USER_ID is allowed to run this workflow." - else - echo "User $USER_ID is not authorized to run this workflow." - exit 1 - fi + - name: "Security Check" + uses: pycord-development/execute-whitelist-action@v1.0.5 + with: + whitelisted-github-ids: ${{ vars.ALLOWED_USER_IDS }} + token: ${{ secrets.GITHUB_TOKEN }} pre_config: needs: [safety_check]