a node.js lambda function that updates github PR statuses based on codebuild events
# clone the repo and install dependencies
$ git clone [email protected]:cludden/tf-codebuild-github-status.git- Clone it (git clone [email protected]:cludden/tf-codebuild-github-status.git)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes using conventional changelog standards (git commit -m 'feat(my-new-feature): Add some feature')
- Push to the branch (git push origin my-new-feature)
- Ensure linting/security/tests are all passing
- Create new Pull Request
Prerequisites:
# run test suite and generate code coverage
$ docker-compose run tf-codebuild-github-status
# run linter
$ docker-compose run tf-codebuild-github-status npm run lint
# run security scan
$ docker-compose run tf-codebuild-github-status npm run sec$ docker-compose run tf-codebuild-github-status
- Merge fixes & features to master
- Run lint check npm run lint
- Run security check npm run sec
- Run full test suite docker-compose run tf-codebuild-github-status
- Run release script npm run release
- Push release & release tag to github git push --follow-tags
- Publish new release in github, using the release notes from the CHANGELOG
Define custom configuration
{
  "github": {
    "url": "https://api.github.com",
    "owner": "my-org",
    "token": "xxxxxxxx"
  },
  "log": {
    "level": "info"
  }
}Add JSON configuration to ssm
$ aws ssm put-parameter --name /secrets/codebuild-trigger/custom --type SecureString --value $JSONCONFIGVia terraform
module "codebuild_trigger" {
  source                     = "git::[email protected]:cludden/tf-codebuild-github-status.git//terraform?ref={version}"
  config_parameter_name      = "/secrets/codebuild-trigger"
  debug                      = ""
  memory_size                = 128
  name                       = "codebuild-github-status"
  node_env                   = "production"
  region                     = "us-west-2"
  s3_bucket                  = "my-artifact-bucket"
  s3_key                     = "tf-codebuild-github-status/${var.version}/index.zip"
  timeout                    = 10
}
Licensed under the MIT License
Copyright (c) 2017 Chris Ludden
