Skip to content

Commit 5e9ecc0

Browse files
committed
fix(aws-codecommit): make the CodePipeline Action CloudWatch Event respect creating the branch as well.
1 parent 3fdbc95 commit 5e9ecc0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/@aws-cdk/aws-codecommit/lib/repository.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export abstract class RepositoryRef extends cdk.Construct {
104104

105105
/**
106106
* Defines a CloudWatch event rule which triggers when a reference is
107-
* created (i.e. a new brach/tag is created) to the repository.
107+
* created (i.e. a new branch/tag is created) to the repository.
108108
*/
109109
public onReferenceCreated(name: string, target?: events.IEventRuleTarget, options?: events.EventRuleProps) {
110110
const rule = this.onStateChange(name, target, options);
@@ -114,11 +114,11 @@ export abstract class RepositoryRef extends cdk.Construct {
114114

115115
/**
116116
* Defines a CloudWatch event rule which triggers when a reference is
117-
* updated (i.e. a commit is pushed to an existig branch) from the repository.
117+
* updated (i.e. a commit is pushed to an existing or new branch) from the repository.
118118
*/
119119
public onReferenceUpdated(name: string, target?: events.IEventRuleTarget, options?: events.EventRuleProps) {
120120
const rule = this.onStateChange(name, target, options);
121-
rule.addEventPattern({ detail: { event: [ 'referenceUpdated' ] } });
121+
rule.addEventPattern({ detail: { event: [ 'referenceCreated', 'referenceUpdated' ] } });
122122
return rule;
123123
}
124124

packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
],
2828
"detail": {
2929
"event": [
30+
"referenceCreated",
3031
"referenceUpdated"
3132
],
3233
"referenceName": [
@@ -599,4 +600,4 @@
599600
}
600601
}
601602
}
602-
}
603+
}

packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-code-commit.expected.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
],
2828
"detail": {
2929
"event": [
30+
"referenceCreated",
3031
"referenceUpdated"
3132
],
3233
"referenceName": [
@@ -289,4 +290,4 @@
289290
}
290291
}
291292
}
292-
}
293+
}

0 commit comments

Comments
 (0)