-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firebase init hosting:github, 404 error if the repo belongs to an organization #40
Comments
I am having the same issue |
EDIT June 17, 2021: Take a look at @alkiko's comment below. You may not need to follow these manual service account creation steps!Thanks for the report, @JohnFitz and @TheBestMoshe! And sorry for the delay in getting back to you. This is a CLI bug, so I've filed it here: firebase/firebase-tools#2763 The workaround is to manually set up this GitHub action yourself until that's fixed. To do that: 1. Create a service account that the action will use to deploy to Hosting
2. Get that service account's key and add it to your repository as a secret
3. Add a workflow yaml file to your repository
Please let me know if you get stuck in any part of the process. Happy to clarify any of the steps in this workaround. (UPDATE Dec 23, 2020: this process is now documented here) |
I report this during a hackhaton :D : ALL you have to do is first grant Firebase CLI 3rd party github app in https://github.com/settings/applications and THEN do firebase init hosting:github. and enter it as organization/repo-name If it's not already among your integrated apps you can run firebase init hosting:github on a repo that YOUR username owns, because that will prompt you with the website to authorize Firabse CLI. |
@jhuleatt I used your steps to create a service account, create and download a key, add the key under "Repository secrets", add the workflow, and then create a PR to trigger the workflow. However, I still get an error: I assumed it was an issue with this line in the workflow: so I also tried changing the line to the following and rerunning: Do you happen to know how to resolve the outstanding error from the steps? |
@najibghadri, thanks for the reply. I reran the test today and it didn't give me the same error. Perhaps it takes some time to propagate the secrets? I received a new error stating that the Firebase Hosting API needed to be enabled, so I enabled that, waited about 20 minutes (since the error mentioned it would take a few minutes to propagate), and then it worked ✅ Much appreciated |
@najibghadri I already see |
I got this error on org repos too. The solution for me was:
After that, I was able to run |
@alkiko Thank you, this worked for me. My organization was listed there but it was granted access (with a red x). You just have to press the Grant button and you can continue going through the Firebase CLI, with no extra steps. Easy Peezy, thank you. |
@alkiko 's answer worked me as well. |
@alkiko Thank you. It worked after granting Firebase CLI access to my GitHub organization |
@alkiko Worked like a charm |
@jhuleatt you should edit your post with the "workaround" and just point people towards this post further down:
None of the complicated manual workaround is required when just following this post, it's way easier! However, since your "workaround" is the first post appearing, I'm afraid many devs come here and first try this manual difficult method... |
This works. Just grant Friebase CLI access to your organisation account. |
Worked like charm! |
|
So do I literally copy the JSON key and paste in the text area... 🤔 |
After following the steps recommend by alkiko I got the error "Error: HTTP Error: 403, Policy update access denied.". The issue seemed to be that I was't the owner of the firebase project, just an editor. |
In my case, I had to remove the forwarding slash |
It may help to run the |
First off, I'm brand new to firebase hosting and github actions, so it's entirely possible that I'm approaching this the wrong way, but I haven't found any mention of this being incorrect in the docs.
To reproduce
firebase init hosting:github
I authenticate successfully, then I'm prompted to enter the name of the repo, and it even suggests the correct repo in the format
my-org-name/my-repo-name
. So, I enter that but get the errorFirebaseError: HTTP Error: 404, Not Found
Analysis
Looking at the firebase-debug.log, it looks like the cli makes the assumption that the repo belongs to a user, which isn't correct in this case i.e. from what I entered, it's forming the request:
HTTP REQUEST GET https://api.github.com/repos/my-org-name/my-repo-name/actions/secrets/public-key?type=owner
but the API is expecting:
...api.github.com/repos/my-github-username/my-repo-name/...
However, if I enter
my-github-username/my-repo-name
at the prompt, I get the same error but that's because the repo doesn't exist under my account, it belongs to the org.Maybe it's a limitation of Github's API? Or maybe your intention is that developers always fork the repo, so this is more of a documentation issue (or lack of knowledge on my behalf)?
To work around this, I'm going to transfer the repo to my account, but I thought I'd mention it here.
The text was updated successfully, but these errors were encountered: