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
695 stars 202 forks source link

[BUG] Error (auth/invalid-api-key) on hosting PR #271

Open sophiiae opened 1 year ago

sophiiae commented 1 year ago

Action config

firebase-hosting-pull-request.yml

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
      - run: npm ci && npm run build
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NEED_CODE }}'
          projectId: need-code

Error message

Screenshot 2023-03-21 at 9 39 12 AM

Expected behavior

The auto PR preview link should be deployed without an error

Screenshot 2023-03-21 at 9 41 20 AM

Link: https://need-code--pr12-update-firebase-depl-7pxhj1zl.web.app/

Actual behavior

desarrollobarter commented 1 year ago

Hi in my case is for not have permissions correct my objetive is make pullrequest of other branch to master and make auto deploy to host firebase i change permission in action workflow file in the firebase-hosting-pull-request.yml and all fine!

location file: username/repositoriname/actions/

the line 'on': pull_request for 'on': pull_request_target

https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

after make pullrequest or push i did it again and work fine

in your case meaby is similar or push_request permission

maxboone commented 12 months ago

the line 'on': pull_request for 'on': pull_request_target

FYI: This means that your preview-build builds the main branch, not the branch that your pull-request is going to merge