commit_message causes an incorrect environment variable
See original GitHub issueWhile using the cdk to create a codepipeline that has a github source action I would like to pass the environment variables down to subsequent steps.
self.source_variables = {
"AUTHOR_DATE": codebuild.BuildEnvironmentVariable(value=self.source_action.variables.author_date),
"BRANCH_NAME": codebuild.BuildEnvironmentVariable(value=self.source_action.variables.branch_name),
"COMMIT_ID": codebuild.BuildEnvironmentVariable(value=self.source_action.variables.commit_id),
# "COMMIT_MESSAGE": codebuild.BuildEnvironmentVariable(value=self.source_action.variables.commit_message),
"COMMITTER_DATE": codebuild.BuildEnvironmentVariable(value=self.source_action.variables.committer_date),
"COMMIT_URL": codebuild.BuildEnvironmentVariable(value=self.source_action.variables.commit_url),
"REPOSITORY_NAME": codebuild.BuildEnvironmentVariable(value=self.source_action.variables.repository_name),
}
However, if the line for commit_message is not commented out then I am met with an error that says the format is wrong: should be [{name, type, value}]
EnvironmentVariables specified in action config does not match expected format, the expected format is JSON array adhering to the following format: [{“name”: “string”, “type”: “string”, “value”: “string”}]
the issue is not present with any other value.
Reproduction Steps
Create a simple codepipeline with a GithubSourceAction and a codebuild action like:
self.build_init_action = actions.CodeBuildAction(
action_name="initialize",
project=build_project,
input=self.source,
outputs=[],
environment_variables=self.source_variables
)
The deploy command will succeed but the details for the second stage will not work with the commit_message.
Error Log
No Errors except when in the console.
EnvironmentVariables specified in action config does not match expected format, the expected format is JSON array adhering to the following format: [{“name”: “string”, “type”: “string”, “value”: “string”}]
Environment
- CLI Version : 1.45
- Framework Version: 1.45
- Node.js Version: v14.3.0
- OS : manjaro linux and mac osx
- Language (Version): python 3.8.3
This is 🐛 Bug Report
It is equally as likely that I am just missing something wildly dumb.
I can provide cf templates at request.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (7 by maintainers)
Top GitHub Comments
OK. So this is a CodePipeline issue then. I’ll get in contact with the team.
It succeeded.