Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CodeBuild Github webhook does not update status of PullRequest

Using the official guide, created build project to run tests on GitHub PullRequests creation. The webhook is correctly shown on GitHub, builds are being triggered in Codebuild, however, the build status is not shown in Github, despite the option Report build status is set true. If I correctly understood the tutorial, Codebuild has native support of GitHub, and after successful creation of a webhook, the new verification check should be added for PR submission automatically, any suggestions to make this work?

like image 601
Roman Kolodiy Avatar asked Sep 14 '18 13:09

Roman Kolodiy


2 Answers

It should work automatically. If builds are triggering but codebuild is not reporting back on the status, then it sounds like the codebuild project no longer has permission to the repo. You could try adding the GitHub source to codebuild again.

"Report build status" actually has no effect when triggered by a webhook, and should always report back in theory (https://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html). It's set to false for my project and always updates the pull requests.

like image 181
Matt Avatar answered Oct 13 '22 06:10

Matt


Ensure the GitHub user has write access to the repository, and if you're using a Personal Access Token (PAT), ensure the repo:status scope is granted:

Grants read/write access to public and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses without granting access to the code.

https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/

(I experienced this issue recently. The PAT had the necessary scopes granted but the GitHub user had read-only access to the repository. Granting the GitHub user write permission solved the problem.)

like image 2
ctgardner Avatar answered Oct 13 '22 06:10

ctgardner