Skip to content

Commit

Permalink
Trying to add pr uathor check in lagoon wf
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceo committed Jun 8, 2024
1 parent 7876483 commit 21f10fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/lagoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,31 @@ env:
LAGOON_PROJECT: "dpl-cms"

jobs:
CheckPrAuthor:
name: Check PR author
runs-on: ubuntu-latest
steps:
- name: Check PR author
run: |
set -e
echo "IGNORED_PR_AUTHORS: ${{ vars.IGNORED_PR_AUTHORS }}"
echo "PR author: ${{ github.event.pull_request.user.login }}"
AUTHOR_IS_IGNORED=$(echo '${{ vars.IGNORED_PR_AUTHORS }}' | jq --arg author "${{ github.event.pull_request.user.login }}" 'any(.[]; . as $ | $author | match($))')
echo "PR author is ${{ github.event.pull_request.user.login }}"
exit 1
if [[ "${{ github.event.pull_request.user.login }}" == "dpl-bot" ]]
then
echo "PR author is dpl-bot. Skipping deployment."
exit 1
fi
if: ${{ vars.IGNORED_PR_AUTHORS }}

BranchNameLength:
name: Check branch length
runs-on: ubuntu-latest
needs: [CheckPrAuthor]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/miktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: mik debug
run: echo ${{ toJson(github.event.pull_request.owner) }}"
run: echo ${{ toJson(github.event.pull_request) }}"

0 comments on commit 21f10fd

Please sign in to comment.