feat: run e2e and deploy workflows from branch if non-fork

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-11-06 20:07:44 +01:00 committed by David Mehren
parent d44c0c6a7e
commit d0e24175d7
2 changed files with 12 additions and 1 deletions

View file

@ -5,6 +5,14 @@
name: deploy
on:
pull_request:
branches: [ main ]
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
pull_request_target:
branches: [ main ]
types:
@ -24,7 +32,7 @@ env:
jobs:
deploy:
if: github.event.pull_request.draft == false || contains( github.event.pull_request.labels.*.name, 'FORCE DEPLOY')
if: (github.event.pull_request.draft == false || contains( github.event.pull_request.labels.*.name, 'FORCE DEPLOY')) && (github.event_name == 'pull_request_target') == github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
name: Deploys to netlify
env:

View file

@ -9,6 +9,8 @@ on:
branches: [ main ]
pull_request_target:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
@ -19,6 +21,7 @@ env:
jobs:
build-frontend:
if: "${{ (github.event_name == 'pull_request_target') == github.event.pull_request.head.repo.fork }}"
runs-on: ubuntu-latest
name: Build test build of frontend
steps: