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 個月前檢視次數 604 次
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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南