google-github-actions / deploy-cloudrun

A GitHub Action for deploying services to Google Cloud Run.
https://cloud.google.com/run
Apache License 2.0
467 stars 115 forks source link

ENV var key value paring in 2.3.0 critical bug #503

Closed scottravio closed 7 months ago

scottravio commented 7 months ago

TL;DR

bug introduced here: https://github.com/google-github-actions/deploy-cloudrun/pull/496

The KV parser creates a delimiter string which does not exist in the input string. This can cause an error when an env var value ends with the start of the delim string.

For instance, if a delim string is dd and I have an ENV var SOMETHING=hello-world SOMETHING_ELSE=foo, the string ends up like SOMETHING=hello-worldddSOMETHING_ELSE=foo, which creates cloud run ENV variables:

SOMETHING=hello-worl
dSOMETHING_ELSE=foo

Expected behavior

ENV variables correctly parsed

Observed behavior

No response

Action YAML

N/A

Log output

No response

Additional information

No response

njhartwell commented 6 months ago

This is still an issue when concatenating the value and delimiter results produces a new occurrence of the delimiter. It's presumably uncommon, but I just saw it happen in the wild.

e.g. for the label commit-sha=xxxx524 and the delimiter 5245

^5245^commit-sha=xxxx5245245ref-name=main

yields 245ref-name=main