Skip to content

Commit

Permalink
Disable deployments for branches from forks (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuthan authored Nov 21, 2022
1 parent 1dd0e80 commit 6d9710a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build

on:
workflow_dispatch: ~
push:
branches:
- master
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/deploy-branch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Deploy Branch

on:
workflow_dispatch: ~
pull_request:
types: [ opened, synchronize, reopened ]

Expand All @@ -13,10 +14,8 @@ jobs:
IMAGE_NAME: eu.gcr.io/${{ secrets.GCP_PROJECT_ID }}/turnilo
REF_NAME: ${{ github.head_ref }}

# add permission to comment PR created by dependantbot
permissions:
issues: write
pull-requests: write
# disable for branches from forks
if: github.repository == 'allegro/turnilo'

steps:
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/undeploy-branch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Undeploy Branch

on:
workflow_dispatch: ~
pull_request:
types: [closed]

Expand All @@ -13,6 +14,9 @@ jobs:
IMAGE_NAME: eu.gcr.io/${{ secrets.GCP_PROJECT_ID }}/turnilo
REF_NAME: ${{ github.head_ref }}

# disable for branches from forks
if: github.repository == 'allegro/turnilo'

steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down

0 comments on commit 6d9710a

Please sign in to comment.