Skip to content

Conversation

@juanmanuelramallo
Copy link
Contributor

Why

Because when using a JSON env var it fails with a message that says:

google-github-actions/deploy-cloud-functions failed with: failed to parse KEY=VALUE pair ""my_key":"my_value"": missing "="

This was happening because an env var was a JSON string and commas were not escaped. Therefore when parsing the env vars it failed when reaching the second key of the JSON string.

What

Adds a clarification to the "env_vars" parameter so that the user knows they need to escape their commas. The clarification was borrowed from the source code of the function that parses the env vars

Signed-off-by: Juan Manuel Ramallo juanmanuelramallo@hey.com

## Why
Because when using a JSON env var it fails with a message that says:

```
google-github-actions/deploy-cloud-functions failed with: failed to parse KEY=VALUE pair ""my_key":"my_value"": missing "="
```

This was happening because an env var was a JSON string and commas were not escaped. Therefore when parsing the env vars it failed when reaching the second key of the JSON string.

## What
Adds a clarification to the "env_vars" parameter so that the user knows they need to escape their commas. The clarification was borrowed from the [source code of the function that parses the env vars](https://github.com/google-github-actions/actions-utils/blob/main/src/kv.ts#L43)

Signed-off-by: Juan Manuel Ramallo <juanmanuelramallo@hey.com>
@google-cla
Copy link

google-cla bot commented Feb 14, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sethvargo sethvargo enabled auto-merge (squash) February 14, 2023 19:33
@sethvargo sethvargo merged commit 7341eec into google-github-actions:main Feb 14, 2023
@juanmanuelramallo juanmanuelramallo deleted the patch-1 branch February 14, 2023 21:04
verbanicm pushed a commit that referenced this pull request May 8, 2023
## What's Changed
* Update CI and deps by @sethvargo in
#367
* Handle 404 vs other errors when getting the Cloud Function by
@sethvargo in
#368
* Improve cleanup script by @sethvargo in
#369
* Update Readme with ingress_settings valid inputs by @m3h0w in
#370
* Update README.md by @juanmanuelramallo in
#372
* chore: update dependencies (automated) by @verbanicm in
#375
* Switch to pull non-secret values from env by @sethvargo in
#376
* Give possible values for memory_mb by @greg-finley in
#377
* Add support info by @sethvargo in
#380
* chore: update dependencies (automated) by @verbanicm in
#382

## New Contributors
* @m3h0w made their first contribution in
#370
* @juanmanuelramallo made their first contribution in
#372
* @greg-finley made their first contribution in
#377

**Full Changelog**:
v1.0.0...cc5c68a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants