aws-actions / aws-secretsmanager-get-secrets

MIT No Attribution
142 stars 38 forks source link

Too strict validation of environment variable names #162

Closed dAnjou closed 1 month ago

dAnjou commented 1 month ago

Hi,

I'd like to set an environment variable called ORG_GRADLE_PROJECT_artifactoryUser, according to https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties:

Environment Variables: You can set project properties with environment variables. If the environment variable name looks like ORG_GRADLE_PROJECT_prop=somevalue, then Gradle will set a prop property on your project object, with the value of somevalue.

$ export ORG_GRADLE_PROJECT_myProperty='Hi, world'

However:

Run aws-actions/aws-secretsmanager-get-secrets@v2

Error: The alias 'ORG_GRADLE_PROJECT_artifactoryUser' is not a valid environment name. Please verify that it has uppercase letters, numbers, and underscore only.

What reason is there to have such rules?

🙏

jirkafajfr commented 1 month ago

You can add name-transformation: none to your action definition that will retain the original casing. You can read more about it in the our readme.

dAnjou commented 1 month ago

Thank you, that worked! 🙏

Maybe the docs can be extended, because it's not obvious that disabling name transformation also disables this validation, especially because I'm setting a name explicitly which shouldn't even be subject to transformation, I think.