# 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: actions/setup-node@v2
with:
node-version: '16'
- run: npm --version
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PROJECT_ID }}'
projectId: project-id
Error message
Deploying to Firebase preview channel pr1-firebase-deploy
/opt/hostedtoolcache/node/16.11.1/x64/bin/npx firebase-tools hosting:channel:deploy pr1-firebase-deploy --expires 7d --project project-id --json
npm WARN exec The following package was not found and will be installed: firebase-tools
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
***
"status": "error",
"error": "HTTP Error: 500, Internal error encountered."
***
***
"status": "error",
"error": "HTTP Error: 500, Internal error encountered."
***
It turns out that this had to do with the dummy configuration data in my repo was not getting properly replaced by a build step. With the correct configuration in place, this action worked as expected.
Action config
Error message
Expected behavior
Action runner finds and installs firebase-tools.
Actual behavior
HTTP Error 500, which causes npx to exit code 2