'Obtaining github PR information like description in Codebuild

Prequisite: I have read: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-pull-request.html

I also read this: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html

and this: Accessing GitHub pull request details within AWS CodeBuild

We have several codebuild jobs that trigger on Github pull requests/pull request updates.

As that other question states, far I have seen $CODEBUILD_WEBHOOK_EVENT which shows something like PULL_REQUEST_UPDATED and CODEBUILD_WEBHOOK_TRIGGER which shows something like pr/123

However I am trying to get the actual payload of the webhook event - specifically the title and description of the PR. How can I obtain these?

My fear is that the answer is this information is lost, and that somehow I need to connect to the github API from within the codebuild job in a back and forth. But then they question will be how to authenticate since this is a private repo..



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source