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
# Example automatically generated from non-compiling source. May contain errors.
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.48.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb5106ce611cff44b68ec12f2dbf5687e76d3c87c2f80e7d079b9f7e9456333 |
|
MD5 | fe82af59bf05f10a251dc963ef74dc27 |
|
BLAKE2b-256 | 0f1cef06b11618e84f83be42e25571ae2d87926338e24f6cd02a42b245228ec8 |
Close
Hashes for cloudcomponents.cdk_github_webhook-1.48.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b32e356f3b7b01fcf625018dfb8888bbd2855903d11582b739cb7538e2967773 |
|
MD5 | 42cae656164dd23f1a41c35569506bd4 |
|
BLAKE2b-256 | d5b5324b97fcd522a6f7cc23ba240740d8a1976164114544f56fc8b9b7c37668 |