An AWS CDK construct that, when attached to a CodePipeline, will make sure success or failure of that pipeline is reflected back to GitHub and shown next to the commit.
This is largely based on the reference architecture, proposed by AWS, minus the SNS topic, since it's not really needed.
npm i @awesome-cdk/cdk-report-codepipeline-status-to-github
import {CodePipelinePostToGitHub} from "@awesome-cdk/cdk-report-codepipeline-status-to-github";
// Create your pipeline with its Stages and all other configuration, as you would normally do it
const pipeline = new codepipeline.Pipeline(this, 'Pipeline', {});
// Use the construct from this package, passing a "Systems Manager - Parameter Store" where you've previously stored your GitHub "Personal Access Token"
const githubToken = StringParameter.fromStringParameterName(this, 'GitHubToken', 'GITHUB_TOKEN');
new CodePipelinePostToGitHub(pipeline, 'CodePipelinePostToGitHub', {
pipeline,
githubToken,
});