aws-codebuild-extras icon indicating copy to clipboard operation
aws-codebuild-extras copied to clipboard

CODEBUILD_ env variables are reserved for internal use

Open joebowbeer opened this issue 7 years ago • 2 comments

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?

joebowbeer avatar Jul 24 '18 13:07 joebowbeer

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.

thii avatar Jul 25 '18 00:07 thii

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?

jdrydn avatar Jul 03 '20 10:07 jdrydn