How to use the @aws-cdk/aws-codepipeline.CfnWebhook function in @aws-cdk/aws-codepipeline

To help you get started, we’ve selected a few @aws-cdk/aws-codepipeline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-codepipeline-actions / lib / github / source-action.ts View on Github external
protected bound(scope: Construct, stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions):
      codepipeline.ActionConfig {
    if (!this.props.trigger || this.props.trigger === GitHubTrigger.WEBHOOK) {
      new codepipeline.CfnWebhook(scope, 'WebhookResource', {
        authentication: 'GITHUB_HMAC',
        authenticationConfiguration: {
          secretToken: this.props.oauthToken.toString(),
        },
        filters: [
          {
            jsonPath: '$.ref',
            matchEquals: 'refs/heads/{Branch}',
          },
        ],
        targetAction: this.actionProperties.actionName,
        targetPipeline: stage.pipeline.pipelineName,
        targetPipelineVersion: 1,
        registerWithThirdParty: true,
      });
    }