Skip to content

Commit

Permalink
Merging next into master (#6659)
Browse files Browse the repository at this point in the history
* Use `checkout@v4` for Firebase Hosting Preview GitHub Workflow (#6441)

When starting a project with `firebase init` with GitHub Workflow,
YAML files were configured with `actions/checkout@v3` previously.

Now, `actions/checkout@v4` has been released,
the template should also be updated to specify the latest version.

https://github.com/actions/checkout/releases/tag/v4.0.0

Co-authored-by: joehan <joehanley@google.com>

* Support export in env parser (#6630)

* Support export in env parser

* use a noncapture group

---------

Co-authored-by: Yutaka Kamei <kamei@yykamei.me>
  • Loading branch information
joehan and yykamei committed Jan 2, 2024
1 parent 29f65d9 commit 7795425
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed an issue where including `export` in .env files caused parsing errors. (#6629)
2 changes: 2 additions & 0 deletions src/functions/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const RESERVED_KEYS = [
const LINE_RE = new RegExp(
"^" + // begin line
"\\s*" + // leading whitespaces
"(?:export)?" + // Optional 'export' in a non-capture group
"\\s*" + // more whitespaces
"([\\w./]+)" + // key
"\\s*=[\\f\\t\\v]*" + // separator (=)
"(" + // begin optional value
Expand Down
2 changes: 1 addition & 1 deletion src/init/features/hosting/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let YML_FULL_PATH_MERGE: string;
const YML_PULL_REQUEST_FILENAME = "firebase-hosting-pull-request.yml";
const YML_MERGE_FILENAME = "firebase-hosting-merge.yml";

const CHECKOUT_GITHUB_ACTION_NAME = "actions/checkout@v3";
const CHECKOUT_GITHUB_ACTION_NAME = "actions/checkout@v4";
const HOSTING_GITHUB_ACTION_NAME = "FirebaseExtended/action-hosting-deploy@v0";

const SERVICE_ACCOUNT_MAX_KEY_NUMBER = 10;
Expand Down
5 changes: 5 additions & 0 deletions src/test/functions/env.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ describe("functions/env", () => {
input: "FOO=foo ",
want: { FOO: "foo" },
},
{
description: "should parse exported values",
input: "export FOO=foo",
want: { FOO: "foo" },
},
{
description: "should parse values with trailing spaces (single quotes)",
input: "FOO='foo' ",
Expand Down

0 comments on commit 7795425

Please sign in to comment.