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.50.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d8117b501dceeca001b8c3338ac298ca3405b35dcccfa92b6ea8e57f86ab498 |
|
MD5 | 5a30a9cf6cd04032432f4a938d89fea3 |
|
BLAKE2b-256 | d88512c5228b3faa49933547a290cd67c2e43c3e5e2b346558a043c5956cb1aa |
Close
Hashes for cloudcomponents.cdk_github_webhook-1.50.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16bcc3746d2d7f75f4062077121c0ff485304cfc09790c60df66ce21960b8154 |
|
MD5 | 7b7fb72c96ee2777f5a1359749ce951b |
|
BLAKE2b-256 | 73933d6d72d8808124b703f80c1bf698b15f5d9418ca65163a0a76d892855c56 |