Skip to content

Commit

Permalink
Skipping whole wf if pr author is not accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceo committed Jun 8, 2024
1 parent 6c1ebc5 commit 303b6cc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/lagoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ jobs:
steps:
- name: Check PR author
run: |
echo "PR Author accepted. Continuing..."
if: ${{ vars.IGNORED_PR_AUTHORS && env.AUTHOR_IS_IGNORED == 'false' }}
set -e
if [[ "${{ env.AUTHOR_IS_IGNORED }}" == "true" ]]
then
echo "${{ format('PR author {0} is not allowed to create Lagoon environments. Skipping deployment...', env.PR_AUTHOR) }}"
exit 1
fi
if: ${{ vars.IGNORED_PR_AUTHORS }}
env:
AUTHOR_IS_IGNORED: $(echo '${{ vars.IGNORED_PR_AUTHORS }}' | jq --arg author "${{ github.event.pull_request.user.login }}" 'any(.[]; . as $user | $author | match($user))')

Expand Down

0 comments on commit 303b6cc

Please sign in to comment.