Skip to content

Commit 76b6569

Browse files
committed
ci: skip Firebase previews for draft PRs
1 parent fbd19e9 commit 76b6569

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/firebase-hosting-pull-request-widgetbook.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
# https://github.com/firebase/firebase-tools
33

44
name: Deploy to Firebase Hosting on PR (Widgetbook)
5-
on: pull_request
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
68
permissions:
79
checks: write
810
contents: read
911
pull-requests: write
1012
jobs:
1113
build_and_preview:
12-
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
14+
if: "${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.draft == false }}"
1315
runs-on: ubuntu-latest
1416
env:
1517
working-directory: ./widgetbook
@@ -44,5 +46,7 @@ jobs:
4446
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ON_TIME_FRONT_WIDGETBOOK }}"
4547
projectId: on-time-front-widgetbook
4648
entryPoint: ${{ env.working-directory }}
49+
channelId: pr-${{ github.event.pull_request.number }}
50+
expires: 3d
4751
env:
4852
FIREBASE_CLI_EXPERIMENTS: webframeworks

.github/workflows/firebase-hosting-pull-request.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
# https://github.com/firebase/firebase-tools
33

44
name: Deploy to Firebase Hosting on PR
5-
on: pull_request
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
68
permissions:
79
checks: write
810
contents: read
911
pull-requests: write
1012
jobs:
1113
build_and_preview:
12-
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
14+
if: "${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.draft == false }}"
1315
runs-on: ubuntu-latest
1416
environment: debug
1517
steps:
@@ -46,5 +48,7 @@ jobs:
4648
repoToken: "${{ secrets.GITHUB_TOKEN }}"
4749
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ONTIME_C63F1 }}"
4850
projectId: ontime-c63f1
51+
channelId: pr-${{ github.event.pull_request.number }}
52+
expires: 3d
4953
env:
5054
FIREBASE_CLI_EXPERIMENTS: webframeworks

0 commit comments

Comments
 (0)