Create, update and delete github webhooks with your app deployment
Project description
@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 { RestApi } from '@aws-cdk/aws-apigateway';
import { Construct, Stack, StackProps } from '@aws-cdk/core';
import { GithubWebhook } from '@cloudcomponents/cdk-github-webhook';
import { SecretKey } from '@cloudcomponents/cdk-secret-key';
export class GithubWebhookStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const api = new RestApi(this, 'github-webhook');
api.root.addMethod('POST');
const githubApiToken = SecretKey.fromPlainText(process.env.API_TOKEN as string);
// @example https://github.com/cloudcomponents/cdk-constructs
const githubRepoUrl = process.env.REPO_URL as string;
// @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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cloudcomponents.cdk-github-webhook-1.49.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4de4bafbf5621b440bc1a6634351190fbbb279d37720a41526b368e55ca4d701 |
|
MD5 | 921e4bb52e03a7d9d921a2cd90eaa0b0 |
|
BLAKE2b-256 | b546ed39615ddfac7a40d7de642f4012cb3ad2920a1d041a06ce88085befed03 |
Close
Hashes for cloudcomponents.cdk_github_webhook-1.49.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c691c22797ea25267b487cd4515969a4ec85a16cf33c5397e9f10c1ad7ab6125 |
|
MD5 | 7ca2a68edd06585598c3e2060870b0b3 |
|
BLAKE2b-256 | 7e6f2b090ad5eb4f2ba800b928d9cc8d5e4004c1eb26f1b667867b18fb508f9e |