Demo that reports a custom-formatted Rick-and-Morty-themed build status to a GitHub pull request. Built on top of AWS Lambda. This example responds to CodeBuild build events in CloudWatch Events, but you can update it to report the status of any kind of job triggered by a pull request.
To install in your AWS account and GitHub account
First, set up a CodeBuild project that builds a repository in your GitHub account, with a GitHub webhook to trigger builds for pull requests. See directions here.
Create a custom OAuth application in your GitHub account:
Run curl -X POST -H "X-GitHub-OTP: 123456" --user "$GITHUB_USERNAME:$GITHUB_PASSWORD" --data "@cli-authorization.json" https://api.github.com/authorizations. Note that the OTP is only necessary if you have MFA enabled for your account.
Store the token (in the 'token' field of the response above) in Parameter Store: aws ssm put-parameter --name ci-rick-github-token --type SecureString --value <OAuth token>
请发表评论