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 name: deploy
on: on:
pull_request:
branches: [ main ]
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
pull_request_target: pull_request_target:
branches: [ main ] branches: [ main ]
types: types:
@ -24,7 +32,7 @@ env:
jobs: jobs:
deploy: 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 runs-on: ubuntu-latest
name: Deploys to netlify name: Deploys to netlify
env: env:

View file

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