You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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>
<!--
Thank you for proposing a pull request! Please note that SOME TESTS WILL
LIKELY FAIL due to how GitHub exposes secrets in Pull Requests from
forks.
Someone from the team will review your Pull Request and respond.
Please describe your change and any implementation details below.
-->
Signed-off-by: Juan Manuel Ramallo <juanmanuelramallo@hey.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ jobs:
61
61
62
62
- `region`: (Optional) [Region](https://cloud.google.com/functions/docs/locations) in which the function should be deployed. Defaults to `us-central1`.
63
63
64
-
- `env_vars`: (Optional) List of key-value pairs to set as environment variables in the format: `KEY1=VALUE1,KEY2=VALUE2`. All existing environment variables will be removed, even if this parameter is not passed.
64
+
- `env_vars`: (Optional) List of key-value pairs to set as environment variables in the format: `KEY1=VALUE1,KEY2=VALUE2`. All existing environment variables will be removed, even if this parameter is not passed. Keys or values that contain a separator must be escaped with a backslash (`\,`, `\\n`). All leading and trailing whitespace is trimmed.
65
65
66
66
- `env_vars_file`: (Optional) Path to a local YAML file with definitions for all environment variables. An example env_vars_file can be found [here](tests/env-var-files/test.good.yaml). All existing environment variables will be removed, even if this parameter is not passed. If `env_vars` is also given, values in `env_vars` take precendence over these values.
0 commit comments