This Lambda function updates the GitHub status of a pull request via CodePipeline events.
Configure a CloudWatch event rule:
{
"source": [
"aws.codepipeline"
],
"detail-type": [
"CodePipeline Stage Execution State Change"
],
"detail": {
"pipeline": [
"my-pipeline"
],
"stage": [
"Build"
]
}
}
and connect it to the Lambda function. Set input to "Input Transformer":
{"pipeline":"$.detail.pipeline","execution-id":"$.detail.execution-id"}
{
"execution-id": <execution-id>,
"github-token": "foobar",
"pipeline": <pipeline>
}
Modify Lambda's policy to allow codepipeline:GetPipelineExecution
.
No tests yet
rake build
This command compiles a Linux binary ./handler
.
rake deploy
This command deploys the code to the already existing Go 1.x Lambda function
codepipeline-github-status
. The handler's name is handler
.