UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 2.75 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.GitHubSourceAction=exports.GitHubTrigger=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline=()=>{var tmp=require("../../../aws-codepipeline");return codepipeline=()=>tmp,tmp},action_1=()=>{var tmp=require("../action");return action_1=()=>tmp,tmp},common_1=()=>{var tmp=require("../common");return common_1=()=>tmp,tmp},GitHubTrigger;(function(GitHubTrigger2){GitHubTrigger2.NONE="None",GitHubTrigger2.POLL="Poll",GitHubTrigger2.WEBHOOK="WebHook"})(GitHubTrigger||(exports.GitHubTrigger=GitHubTrigger={}));class GitHubSourceAction extends action_1().Action{constructor(props){super({...props,category:codepipeline().ActionCategory.SOURCE,owner:"ThirdParty",provider:"GitHub",artifactBounds:(0,common_1().sourceArtifactBounds)(),outputs:[props.output]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_actions_GitHubSourceActionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,GitHubSourceAction),error}this.props=props}get variables(){return{repositoryName:this.variableExpression("RepositoryName"),branchName:this.variableExpression("BranchName"),authorDate:this.variableExpression("AuthorDate"),committerDate:this.variableExpression("CommitterDate"),commitId:this.variableExpression("CommitId"),commitMessage:this.variableExpression("CommitMessage"),commitUrl:this.variableExpression("CommitUrl")}}bound(scope,stage,_options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_IStage(stage),jsiiDeprecationWarnings().aws_cdk_lib_aws_codepipeline_ActionBindOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bound),error}return(!this.props.trigger||this.props.trigger===GitHubTrigger.WEBHOOK)&&new(codepipeline()).CfnWebhook(scope,"WebhookResource",{authentication:"GITHUB_HMAC",authenticationConfiguration:{secretToken:this.props.oauthToken.unsafeUnwrap()},filters:[{jsonPath:"$.ref",matchEquals:"refs/heads/{Branch}"}],targetAction:this.actionProperties.actionName,targetPipeline:stage.pipeline.pipelineName,targetPipelineVersion:1,registerWithThirdParty:!0}),{configuration:{Owner:this.props.owner,Repo:this.props.repo,Branch:this.props.branch||"master",OAuthToken:this.props.oauthToken.unsafeUnwrap(),PollForSourceChanges:this.props.trigger===GitHubTrigger.POLL}}}}exports.GitHubSourceAction=GitHubSourceAction,_a=JSII_RTTI_SYMBOL_1,GitHubSourceAction[_a]={fqn:"aws-cdk-lib.aws_codepipeline_actions.GitHubSourceAction",version:"2.202.0"};