FirebaseExtended / action-hosting-deploy

Automatically deploy shareable previews for your Firebase Hosting sites
https://firebase.google.com/docs/hosting/github-integration
Apache License 2.0
705 stars 202 forks source link

[BUG] Deploys broken with upgrade from `firebase-tools@9.14.0` to `firebase-tools@9.15.0` #137

Closed dgpc closed 3 years ago

dgpc commented 3 years ago

Action config

  deploy_frontend:
    name: "Deploy Frontend"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Build Frontend
        working-directory: frontend
        run: |
          npm ci
          npm run build-staging
      - name: Deploy Live
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          entryPoint: frontend
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_STAGING }}"
          channelId: live
          target: staging
          projectId: <redacted>

Error message

For several months, until today, this action has been working without any issues. Today it started failing with the error:

Run FirebaseExtended/action-hosting-deploy@v0
  with:
    entryPoint: frontend
    repoToken: ***
    firebaseServiceAccount: ***

    channelId: live
    target: staging
    projectId: <redacted>
    expires: 7d
Verifying firebase.json exists
  Changing to directory: frontend
  firebase.json file found. Continuing deploy.
Setting up CLI credentials
  Created a temporary file with Application Default Credentials.
Deploying to production site
  /usr/local/bin/npx firebase-tools deploy --only hosting:staging --project <redacted> --json
  ***
    "status": "error",
    "error": "There was an error loading firebase.json:\n\nENOENT: no such file or directory, open '/home/runner/.npm/_npx/1776/lib/node_modules/firebase-tools/schema/firebase-config.json'"
  ***
  ***
    "status": "error",
    "error": "There was an error loading firebase.json:\n\nENOENT: no such file or directory, open '/home/runner/.npm/_npx/1776/lib/node_modules/firebase-tools/schema/firebase-config.json'"
  ***

  The process '/usr/local/bin/npx' failed with exit code 1
  Retrying deploy with the --debug flag for better error output
  /usr/local/bin/npx firebase-tools deploy --only hosting:staging --project <redacted> --debug

  Error: There was an error loading firebase.json:

  ENOENT: no such file or directory, open '/home/runner/.npm/_npx/1860/lib/node_modules/firebase-tools/schema/firebase-config.json'

  Error: There was an error loading firebase.json:

  ENOENT: no such file or directory, open '/home/runner/.npm/_npx/1860/lib/node_modules/firebase-tools/schema/firebase-config.json'

  The process '/usr/local/bin/npx' failed with exit code 1
  Error: The process '/usr/local/bin/npx' failed with exit code 1
  ***
    conclusion: 'failure',
    output: ***
      title: 'Deploy preview failed',
      summary: "Error: The process '/usr/local/bin/npx' failed with exit code 1"
    ***
  ***

Expected behavior

The most recent successful run (around 2 hours ago), had this output:

Run FirebaseExtended/action-hosting-deploy@v0
Verifying firebase.json exists
Setting up CLI credentials
Deploying to production site
***
  details_url: 'https://<redacted>.web.app/',
  conclusion: 'success',
  output: ***
    title: 'Production deploy succeeded',
    summary: '[<redacted>.web.app](https://<redacted>.web.app/)'
  ***
***

Notes

I believe this is triggered by the release of firebase-tools v9.15.0, which was release a couple of hours ago. I'm seeing similar errors in another custom Github action that relies on firebase tools, and pinning my action to 9.14.0 works around the problem.

canzhiye commented 3 years ago

any ideas for a workaround?

dgpc commented 3 years ago

Upstream fix is in 9.15.1 apparently: https://github.com/firebase/firebase-tools/issues/3563