CodeCommit not outputing expected environment variables to CodePipeline namespace

Viewed 436

I'm trying to setup a pipeline through the AWS web console. The whole thing runs smoothly, but I have a problem with the varaibles outputted by CodeCommit that should be available to the following actions.

In the CodeCommit action configuration, the Variables namespace is set to SourceVariables. enter image description here

In the CodeBuild action configuration, I defined a BRANCH environment variable supposed to map BranchName of the SourceVariables namespace, which should be outputted by the CodeCommit action based on this variable reference.

The BRANCH substitution works in CodeBuild... and yet.

enter image description here

This is hardly what I expected.

What am I missing in order to CodePipeline to value this environment variable from CodeCommit as expected?

2 Answers

If you're using the value of that variables in the S3Deploy action, have you tried using env/exported-variables in your buildspec.yml file?

More information available here

The image you provided is from the CodeBuild configuration page, but you need to set your environment variable in the CodePipeline Action configuration page.enter image description here

Related