firebase-tools: firebase-tools v11.14.0 does not run predeploy scripts when deploying Hosting from GitHub Actions
[REQUIRED] Environment info
firebase-tools: 11.14.0
Platform: Ubuntu
[REQUIRED] Test case
N/A right now, maybe someone can help add a test case if they are experiencing the same issue. However, a log is available below, and it is confirmed that this only happens in v11.14.0.
I can reproduce this in one of my open-source projects, WebMIDICon:
[REQUIRED] Steps to reproduce
We use https://github.com/FirebaseExtended/action-hosting-deploy to deploy. The command is this:
name: Firebase Preview
on:
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- run: yarn
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
expires: 30d
projectId: "${{ secrets.FIREBASE_PROJECT_ID }}"
This results in this command invoked:
npx firebase-tools hosting:channel:deploy pr285-octopus-perf --expires 30d --project $FIREBASE_PROJECT_ID --json
[REQUIRED] Expected behavior
firebase deploy
should trigger the “predeploy” steps configured in “firebase.json”
[REQUIRED] Actual behavior
firebase deploy
did not run the script at all.
See image below for log comparison (before/after):
Workaround
Downgrade firebase-tools
to 11.13.0 before running.
# Temporarily downgrade to `firebase-tools@11.13.0` because of a bug in `v11.14.0`.
# See: https://github.com/firebase/firebase-tools/issues/5072
# Do not use `--global` flag when installing because the `actions-hosting-deploy` action will not pick it up.
- run: npm install firebase-tools@11.13.0
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
expires: 30d
projectId: "${{ secrets.FIREBASE_PROJECT_ID }}"
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 19 (8 by maintainers)
This also affects my project. If I manually build, it shows an even weirder error on the log that the deployment action failed because it could not list my cloud functions (I’m deploying to hosting)
firebase-debug.log
Ditto! Adding the following command before calling using
FirebaseExtended/action-hosting-deploy@v0
worked like a charm.@johnnyasantoss the permissions issue you see is #5071 and has a fix on the way, fwiw. 🙂 I’m just really stumped on trying to get this issue happening locally.