I\'m setup AWS CodeBuild to build automatically from GitHub. Other CI services provide an environment variable for the branch, but I can\'t find one for AWS CodeBuild. There is
Add the following command to the install
or pre_build
phase of your buildspec.yml:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/thii/aws-codebuild-extras/master/install)"
You can get more information about the build via the following environment variables:
CI
,
CODEBUILD
,
CODEBUILD_GIT_AUTHOR
,
CODEBUILD_GIT_AUTHOR_EMAIL
,
CODEBUILD_GIT_BRANCH
,
CODEBUILD_GIT_COMMIT
,
CODEBUILD_GIT_MESSAGE
,
CODEBUILD_GIT_TAG
,
CODEBUILD_PROJECT
,
CODEBUILD_PULL_REQUEST
.