Skip to content

Commit

Permalink
Update root.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPates committed Jan 23, 2023
1 parent 28d1eb9 commit e500781
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ func Execute() {
func Handler(ctx context.Context, event events.CodePipelineEvent) (string, error) {
log.Debug(event)
err := rootCmd.Execute()
s := session.Must(session.NewSession())
cpl := codepipeline.New(s)
if err != nil {
// notify codepipeline and mark its job execution as Failure
s := session.Must(session.NewSession())
log.Fatal("Notifying CodePipeline and mark its job execution as Failure")
jobID := event.CodePipelineJob.ID
if len(jobID) == 0 {
Expand All @@ -102,8 +103,6 @@ func Handler(ctx context.Context, event events.CodePipelineEvent) (string, error
}
return "Failure", err
}
s := session.Must(session.NewSession())
cpl := codepipeline.New(s)
log.Info("Notifying CodePipeline and mark its job execution as Success")
jobID := event.CodePipelineJob.ID
if len(jobID) == 0 {
Expand Down

0 comments on commit e500781

Please sign in to comment.