@cloudcomponents/cdk-github-webhook
Create, update and delete github webhooks with your app deployment
Install
TypeScript/JavaScript:
npm i @cloudcomponents/cdk-github-webhook
Python:
pip install cloudcomponents.cdk-github-webhook
How to use
import { GithubWebhook } from '@cloudcomponents/cdk-github-webhook';
import { SecretKey } from '@cloudcomponents/cdk-secret-key';
import { Stack, StackProps, aws_apigateway } from 'aws-cdk-lib';
import { Construct } from 'constructs';
export class GithubWebhookStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const api = new aws_apigateway.RestApi(this, 'github-webhook');
api.root.addMethod('POST');
if (typeof process.env.API_TOKEN === 'undefined') {
throw new Error('environment variable API_TOKEN undefined');
}
const githubApiToken = SecretKey.fromPlainText(process.env.API_TOKEN);
// @example https://github.com/cloudcomponents/cdk-constructs
if (typeof process.env.REPO_URL === 'undefined') {
throw new Error('environment variable REPO_URL undefined');
}
const githubRepoUrl = process.env.REPO_URL;
// @see https://developer.github.com/v3/activity/events/types/
const events = ['*'];
new GithubWebhook(this, 'GithubWebhook', {
githubApiToken,
githubRepoUrl,
payloadUrl: api.url,
events,
logLevel: 'debug',
});
}
}
API Reference
See API.md.
Example
See more complete examples.
License
Metadata
Release files for cloudcomponents.cdk-github-webhook 2.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cloudcomponents.cdk-github-webhook-2.4.0.tar.gz | 629.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cloudcomponents.cdk_github_webhook-2.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / cloudcomponents.cdk-github-webhook-2.4.0.tar.gz
| Download URL | cloudcomponents.cdk-github-webhook-2.4.0.tar.gz |
|---|---|
| Size | 629.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
319857086e3dec45b40fa3eb7272dee1ee48ce970fff895bac18534088b28b09
|
|
BLAKE2b-256 checksum How to use checksums |
c1eb49ac1183a5461a9dd7b291ca71e5fb0afc86aefd19532f18980c1f57554c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / cloudcomponents.cdk_github_webhook-2.4.0-py3-none-any.whl
| Download URL | cloudcomponents.cdk_github_webhook-2.4.0-py3-none-any.whl |
|---|---|
| Size | 628.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a7e3f6ca32046ac602490e07f29bd1a9bdebf0aa1852bca44725143699976c0
|
|
BLAKE2b-256 checksum How to use checksums |
ff30e26c92ab09ad93dba08bb2ffa615ff9852bba48f920bc38229b3909653be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|