action-hosting-deploy: [BUG] Permission 'cloudfunctions.functions.list' denied
Action config
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
expires: 30d
projectId: my-awesome-project
Error message
This has been working for years, and now we’re starting noticing this error:
"HTTP Error: 403, Permission 'cloudfunctions.functions.list' denied on 'projects/<my-project>/locations/-/functions'"
Expected behavior
Deploy without needed permission.
Actual behavior
Fails to deploy.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 38
- Comments: 45
In cloud.google.com click ‘IAM & Admin’, then look for the principal with ‘github-action’, hit the pencil to edit, click ‘add another role’ and add ‘cloud functions viewer’. BTW, make sure you’re in the right project (i have multiple)
I couldn’t wait for the fix, so I ended up adding the
cloudfunctions.viewer
role (akaCloud Functions Viewer
) to the service account and deployment workedSince I didn’t want to give the service account more permissions I tried pinning the version to
11.13.0
(usingnpm install --save-dev firebase-tools@11.13.0
for the project).So far the best workaround for me.
In my case adding “Cloud Functions Viewer” role to the GitHub actions service account helped. The service account name looks something like
github-action-<some-number>@<project-id>.iam.gserviceaccount.com
Why hosting need functions permission. Please fix.
What worked for us was adding Cloud Functions Viewer role to all the associated github service accounts and enabled the Cloud Functions API.
Google’s policy was changed? Yesterday, everything was good, but today I faced such issue. Why this happen?
Same here. enabling cloudfunctions.googleapis.com in the project and adding roles/cloudfunctions.viewer to the service account works for me
same situation, yesterday it was good but seeing this error now. I am using FirebaseExtended/action-hosting-deploy@v0 Adding Cloud Function Viewer role didn’t solve my problem.
This just cropped up for us as well, including
--only hosting
Same here. Looks like
firebase-tools
introduced some issues ~24h ago with release 10.9.0, and have put out a couple of release fixes since then. Am hoping the problem resolves itself with these fixes. https://github.com/firebase/firebase-tools/releasesSame here. Adding Cloud Function Viewer role didn’t solve the issue.
same situation, yesterday all good, today this error and also adding the Cloud Function Viewer role did not solve the issue
In my case adding just a role didn’t do anything. I had to open the link which was suggested in error message which redirected me to
API and services
section of that project in GCP and I searched and added a new service namedgoogle cloud functions
I think if you have it installed via package.json it will be listed there, otherwise Github Actions would automatically install it for you and therefore it would probably install the latest version automatically.
Which would be listed under “Run FirebaseExtended/action-hosting-deploy@v0” > “Deploying to Firebase preview channel”.
You can follow this to get resolved
https://github.com/FirebaseExtended/action-hosting-deploy/issues/203#issuecomment-1129053273
It worked for me as well 🎉