thii / aws-codebuild-extras

Add extra information of your AWS CodeBuild build via environment variables.
150 stars 115 forks source link

CODEBUILD_ env variables are reserved for internal use #1

Open joebowbeer opened 6 years ago

joebowbeer commented 6 years ago

The Build Specification Reference for AWS CodeBuild states:

Do not set any environment variable with a name that begins with CODEBUILD_. This prefix is reserved for internal use.

Choose a different prefix for the added env variables?

thii commented 6 years ago

I know. I didn’t want to make their names too long so I just used the same prefix. I believe there’s no conflict with any internal one for now.

jdrydn commented 4 years ago

The Build Specification Reference for AWS CodeBuild states:

Do not set any environment variable with a name that begins with CODEBUILD_. This prefix is reserved for internal use.

So for (nearly) the past 2 years, this has been a documented-yet-unenforced point, so when CodeBuild is triggered by CodePipeline (and the resulting git data is lost) all I need to do was set CODEBUILD_GIT_BRANCH as an environment variable in the pipeline, and this script continued to work (rather nicely, too).

Due to recent changes in CodePipeline (literally, within the past few days, last build that executed cleanly was June 30th), that custom environment variable "fix" now errors with:

No user environment variables can start with CODEBUILD_

It may be worth changing the prefix now? CODEBUILDEXTRAS_ seems logical enough?