Skip to content
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

fix: bail out of firebase init hosting:github early with helpful message if Hosting isn't set up #3114

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,3 +2,4 @@
- Fixes issue with filtering on a specific storage bucket using functions in the emulator (#3893)
- Fixes check in Cloud Functions for Firebase initialization to check for API enablement before trying to enable them. (#2574)
- No longer tries to clean up function build images from Artifact Registry when Artifact Registry is not enabled (#3943)
- Show error message when running `firebase init hosting:github` with no Hosting config in `firebase.json` (#3113)
6 changes: 6 additions & 0 deletions src/init/features/hosting/github.ts
Expand Up @@ -54,6 +54,12 @@ export async function initGitHub(setup: Setup, config: any, options: any): Promi
return reject("Could not determine Project ID, can't set up GitHub workflow.", { exit: 1 });
}

if (!setup.config.hosting) {
return reject(
`Didn't find a Hosting config in firebase.json. Run ${bold("firebase init hosting")} instead.`
);
}

logger.info();

// Find existing Git/Github config
Expand Down