Well, the standard says
These strings have the form name=value; names shall not contain the character ‘=’. For values to be portable across systems conforming to IEEE Std 1003.1-2001, the value shall be composed of characters from the portable character set (except NUL and as indicated below).
So any character except of
NUL are valid names for environment variables.
The standard furthermore says
Environment variable names used by the utilities in the Shell and Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase letters, digits, and the ‘_’ (underscore) from the characters defined in Portable Character Set and do not begin with a digit. Other characters may be permitted by an implementation; applications shall tolerate the presence of such names. Uppercase and lowercase letters shall retain their unique identities and shall not be folded together. The name space of environment variable names containing lowercase letters is reserved for applications. Applications can define any environment variables with names from this name space without modifying the behavior of the standard utilities.
So the standard just defines what utilities volume of the standard use as names and Bash just only supports these characters (uppercase, lowercase, underscore, numbers). But the environment variable names with other characters are perfectly vaild according to the standard. This also explains why using the
env utililty you can perfectly fine set environment variables with dots in their names.
So this can actually be seen as bug, that you do not support all valid environment variable names.
Even if you will not support vaild environment variable names, you should at least fix that it seems as the variable is set if it is defined in circle.yml. As you can see at https://circleci.com/gh/Vampire/gradle-semantic-build-versioning/119#config/containers/0, CircleCI says it set the environment variable and does not give any indication that it did not work, yet it did not work.
But please support this perfectly valid use-case.