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
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠