Skip to content

Update action-hosting-deploy workflow template #3326

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

Merged
merged 5 commits into from
Apr 30, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
- Add support for emulating the `demo-*` project ID namespace with fake Admin and Web SDK configurations (#3291).
- Update Cloud Firestore emulator to v1.11.15 which fixes unexpected PERMISSION_DENIED errors when headers are empty (#3258)
- Fix Auth emulator export only exporting 20 users. (#3311)
- Update the workflow template generated by `firebase init hosting:github` so that the preview action doesn't attempt to run on PRs from forks (#3326)
8 changes: 2 additions & 6 deletions src/init/features/hosting/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ type GitHubWorkflowConfig = {
on: string | { [key: string]: { [key: string]: string[] } };
jobs: {
[key: string]: {
if?: string;
"runs-on": string;
steps: {
uses?: string;
Expand All @@ -291,6 +292,7 @@ function writeChannelActionYMLFile(
on: "pull_request",
jobs: {
["build_and_preview"]: {
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}", // secrets aren't accessible on PRs from forks
"runs-on": "ubuntu-latest",
steps: [{ uses: CHECKOUT_GITHUB_ACTION_NAME }],
},
Expand All @@ -310,9 +312,6 @@ function writeChannelActionYMLFile(
firebaseServiceAccount: `\${{ secrets.${secretName} }}`,
projectId: projectId,
},
env: {
FIREBASE_CLI_PREVIEWS: "hostingchannels",
},
});

const ymlContents = `# This file was auto-generated by the Firebase CLI
Expand Down Expand Up @@ -357,9 +356,6 @@ function writeDeployToProdActionYMLFile(
channelId: "live",
projectId: projectId,
},
env: {
FIREBASE_CLI_PREVIEWS: "hostingchannels",
},
});

const ymlContents = `# This file was auto-generated by the Firebase CLI
Expand Down