Skip to content

Update action-hosting-deploy workflow template - #3326

Merged
jhuleatt merged 5 commits into
masterfrom
jhuleatt-previewaction-limit-forks
Apr 30, 2021
Merged

Update action-hosting-deploy workflow template#3326
jhuleatt merged 5 commits into
masterfrom
jhuleatt-previewaction-limit-forks

Conversation

@jhuleatt

@jhuleatt jhuleatt commented Apr 30, 2021

Copy link
Copy Markdown
Contributor

Description

Update the default workflow template for the Deploy to Firebase Hosting action:

  • Don't run on forks. Github secrets aren't available to forks, so the action will always fail on a PR from a fork.
  • Remove the preview flag because channels aren't in preview any more

We check to see if a PR is from a fork with:

if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'

I found the check in this community post, and @samtstern tested it in google/devlibrary#18

Scenarios Tested

firebase init hosting:github

Here's the diff between the old output of firebase-hosting-pull-request.yml and the new one:

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
jobs:
  build_and_preview:
+   if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_MY_PROJECT }}'
          projectId: my-project
-       env:
-         FIREBASE_CLI_PREVIEWS: hostingchannels

@google-cla google-cla Bot added the cla: yes Manual indication that this has passed CLA. label Apr 30, 2021
@jhuleatt
jhuleatt marked this pull request as ready for review April 30, 2021 14:11
@jhuleatt
jhuleatt requested review from bkendall and samtstern April 30, 2021 14:11
@samtstern
samtstern self-requested a review April 30, 2021 14:20
Comment thread src/init/features/hosting/github.ts Outdated
@jhuleatt
jhuleatt merged commit a0d657c into master Apr 30, 2021
@bkendall
bkendall deleted the jhuleatt-previewaction-limit-forks branch August 4, 2021 19:26
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Manual indication that this has passed CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants