File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1
1
AWSTemplateFormatVersion : 2010-09-09
2
+ Transform : ' AWS::Serverless-2016-10-31'
2
3
3
4
Description : Perform continuous integration pull request checks on a CodeCommit repository with CodeBuild
4
5
@@ -196,3 +197,45 @@ Resources:
196
197
- - !Ref 'AWS::StackName'
197
198
- CodeBuild
198
199
Type : AWS::IAM::Role
200
+
201
+ PullRequestBuildComments :
202
+ Type : ' AWS::Serverless::Function'
203
+ Properties :
204
+ Handler : codecommit_pr_notifications.handler
205
+ Runtime : nodejs8.10
206
+ CodeUri : ../ci_tools
207
+ Description : >-
208
+ Comment on the CodeCommit pull request when a build is triggered and when it completes
209
+ Policies :
210
+ - AWSLambdaBasicExecutionRole
211
+ - Version : ' 2012-10-17'
212
+ Statement :
213
+ - Effect : Allow
214
+ Action :
215
+ - codecommit:PostCommentForPullRequest
216
+ Resource :
217
+ - !Join
218
+ - ' :'
219
+ - - arn
220
+ - aws
221
+ - codecommit
222
+ - !Ref ' AWS::Region'
223
+ - !Ref ' AWS::AccountId'
224
+ - !Ref CodeCommitRepoName
225
+ - Effect : Allow
226
+ Action :
227
+ - logs:GetLogEvents
228
+ Resource : !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/*"
229
+ Events :
230
+ BuildTrigger :
231
+ Type : CloudWatchEvent
232
+ Properties :
233
+ Pattern :
234
+ source :
235
+ - aws.codebuild
236
+ detail-type :
237
+ - CodeBuild Build State Change
238
+ detail :
239
+ additional-information :
240
+ initiator :
241
+ - !Sub " rule/${SourceEvent}"
You can’t perform that action at this time.
0 commit comments