[BUG] Error (auth/invalid-api-key) on hosting PR
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
Expected behavior
The auto PR preview link should be deployed without an error

Link: https://need-code--pr12-update-firebase-depl-7pxhj1zl.web.app/
Actual behavior
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
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