How do you integrate a CodeStar connection with Github status checks?

0

Other CI/CD solutions like Circle CI make it easy to set up a status check in Github, so that if a build fails, a branch can't be merged.

How can I do that in a CodeBuild / CodePipeline with a CodeStar connection?

已提问 10 个月前605 查看次数
1 回答
1

Please note that it is currently not possible to integrate a CodeStar connection with Github status checks. That said, I have raised an internal feature request with my internal team for this use-case. Unfortunately, I am not in position to provide you with ETA as we do not have visibility into service release timelines. Therefore, I would suggest you to monitor the following pages, where AWS advertises all the new feature releases:

What’s New: http://aws.amazon.com/new/
AWS blogs: https://aws.amazon.com/blogs/aws/

To achieve your requirement, you can use any of the below two workarounds.

Option 1 : [Recommend] Use CodeBuild directly which provides a feature to report build statuses to source provider.

  1. Create build project with source GitHub and while configuring source select option, “Report build statuses to source provider when your builds start and finish”. Then, Using Webhook and event filter you can trigger build based on “PULL_REQUEST_CREATED”. I am attaching screenshot at the end for your reference.

  2. In case, if you have other actions to be performed based on the build output then you can chose to send the build output artifact to S3. To achieve this you have to include artifact section in your buildspec. Refer [2] for example buildspec.

  3. Now, create a CodePipeline with source as S3 ( Build Output Artifact S3 ) and include other actions/stages that needs to be performed on your build code.

Current setup : CodeStar Connection -> CodeBuild -> Some other actions Suggestion :

  • Create CodeBuild project separately with GitHub and webhook.
  • Create CodePipeline with S3 as Source ( Build Output Artifact S3 bucket ) -> Some other actions.

[2] Additionally, you can implement custom solution as discussed in our AWS blog [3] through integration of Codepipeline, SNS and Lambda to report status to GitHub. Please refer [3] for detailed steps.

Reference:

[1] https://aws.amazon.com/es/blogs/devops/aws-codepipeline-build-status-in-a-third-party-git-repository/
[2] https://docs.aws.amazon.com/codebuild/latest/userguide/getting-started-cli-create-build-spec.html
[3] https://aws.amazon.com/es/blogs/devops/aws-codepipeline-build-status-in-a-third-party-git-repository/

Enter image description here Enter image description here

AWS
支持工程师
已回答 10 个月前
profile picture
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则