Class: AWSCDK::CodePipelineActions::GitHubSourceActionProps
- Inherits:
-
AWSCDK::Codepipeline::CommonActionProps
- Object
- AWSCDK::Codepipeline::CommonActionProps
- AWSCDK::CodePipelineActions::GitHubSourceActionProps
- Defined in:
- code_pipeline_actions/git_hub_source_action_props.rb
Overview
Construction properties of the GitHubSourceAction GitHub source action.
Instance Attribute Summary collapse
-
#action_name ⇒ String
readonly
The physical, human-readable name of the Action.
-
#branch ⇒ String?
readonly
The branch to use.
-
#oauth_token ⇒ AWSCDK::SecretValue
readonly
A GitHub OAuth token to use for authentication.
- #output ⇒ AWSCDK::Codepipeline::Artifact readonly
-
#owner ⇒ String
readonly
The GitHub account/user that owns the repo.
-
#repo ⇒ String
readonly
The name of the repo, without the username.
-
#run_order ⇒ Numeric?
readonly
The runOrder property for this Action.
-
#trigger ⇒ AWSCDK::CodePipelineActions::GitHubTrigger?
readonly
How AWS CodePipeline should be triggered.
-
#variables_namespace ⇒ String?
readonly
The name of the namespace to use for variables emitted by this action.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(action_name:, run_order: nil, variables_namespace: nil, oauth_token:, output:, owner:, repo:, branch: nil, trigger: nil) ⇒ GitHubSourceActionProps
constructor
A new instance of GitHubSourceActionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(action_name:, run_order: nil, variables_namespace: nil, oauth_token:, output:, owner:, repo:, branch: nil, trigger: nil) ⇒ GitHubSourceActionProps
Returns a new instance of GitHubSourceActionProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 16 def initialize(action_name:, run_order: nil, variables_namespace: nil, oauth_token:, output:, owner:, repo:, branch: nil, trigger: nil) @action_name = action_name Jsii::Type.check_type(@action_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actionName") @run_order = run_order Jsii::Type.check_type(@run_order, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "runOrder") unless @run_order.nil? @variables_namespace = variables_namespace Jsii::Type.check_type(@variables_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "variablesNamespace") unless @variables_namespace.nil? @oauth_token = oauth_token Jsii::Type.check_type(@oauth_token, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TZWNyZXRWYWx1ZSJ9")), "oauthToken") @output = output Jsii::Type.check_type(@output, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lLkFydGlmYWN0In0=")), "output") @owner = owner Jsii::Type.check_type(@owner, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "owner") @repo = repo Jsii::Type.check_type(@repo, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "repo") @branch = branch Jsii::Type.check_type(@branch, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branch") unless @branch.nil? @trigger = trigger Jsii::Type.check_type(@trigger, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZXBpcGVsaW5lX2FjdGlvbnMuR2l0SHViVHJpZ2dlciJ9")), "trigger") unless @trigger.nil? end |
Instance Attribute Details
#action_name ⇒ String (readonly)
The physical, human-readable name of the Action.
Note that Action names must be unique within a single Stage.
42 43 44 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 42 def action_name @action_name end |
#branch ⇒ String? (readonly)
Default: "master"
The branch to use.
88 89 90 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 88 def branch @branch end |
#oauth_token ⇒ AWSCDK::SecretValue (readonly)
A GitHub OAuth token to use for authentication.
It is recommended to use a Secrets Manager Secret to obtain the token:
const oauth = cdk.SecretValue.secretsManager('my-github-token'); new GitHubSourceAction(this, 'GitHubAction', { oauthToken: oauth, ... });
If you rotate the value in the Secret, you must also change at least one property of the CodePipeline to force CloudFormation to re-read the secret.
The GitHub Personal Access Token should have these scopes:
- repo - to read the repository
- admin:repo_hook - if you plan to use webhooks (true by default)
73 74 75 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 73 def oauth_token @oauth_token end |
#output ⇒ AWSCDK::Codepipeline::Artifact (readonly)
75 76 77 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 75 def output @output end |
#owner ⇒ String (readonly)
The GitHub account/user that owns the repo.
79 80 81 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 79 def owner @owner end |
#repo ⇒ String (readonly)
The name of the repo, without the username.
83 84 85 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 83 def repo @repo end |
#run_order ⇒ Numeric? (readonly)
Default: 1
The runOrder property for this Action.
RunOrder determines the relative order in which multiple Actions in the same Stage execute.
50 51 52 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 50 def run_order @run_order end |
#trigger ⇒ AWSCDK::CodePipelineActions::GitHubTrigger? (readonly)
Default: GitHubTrigger.WEBHOOK
How AWS CodePipeline should be triggered.
With the default value "WEBHOOK", a webhook is created in GitHub that triggers the action With "POLL", CodePipeline periodically checks the source for changes With "None", the action is not triggered through changes in the source
To use WEBHOOK, your GitHub Personal Access Token should have
admin:repo_hook scope (in addition to the regular repo scope).
100 101 102 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 100 def trigger @trigger end |
#variables_namespace ⇒ String? (readonly)
Default: - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set
The name of the namespace to use for variables emitted by this action.
55 56 57 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 55 def variables_namespace @variables_namespace end |
Class Method Details
.jsii_properties ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 102 def self.jsii_properties { :action_name => "actionName", :run_order => "runOrder", :variables_namespace => "variablesNamespace", :oauth_token => "oauthToken", :output => "output", :owner => "owner", :repo => "repo", :branch => "branch", :trigger => "trigger", } end |
Instance Method Details
#to_jsii ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'code_pipeline_actions/git_hub_source_action_props.rb', line 116 def to_jsii result = {} result.merge!(super) result.merge!({ "actionName" => @action_name, "runOrder" => @run_order, "variablesNamespace" => @variables_namespace, "oauthToken" => @oauth_token, "output" => @output, "owner" => @owner, "repo" => @repo, "branch" => @branch, "trigger" => @trigger, }) result.compact end |