Skip to content

Commit

Permalink
Merge pull request #12 from zapier/fix-release-locks-msg
Browse files Browse the repository at this point in the history
Revert change on how release locks msg is created and fix infinite loop bug
  • Loading branch information
davidwin93 authored Jan 9, 2023
2 parents 7426773 + 2dd1d1d commit 2071ecc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/tfc_trigger/tfc_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ func (t *TFCTrigger) TriggerTFCEvents() (*TriggeredTFCWorkspaces, error) {
}

} else if t.cfg.GetTriggerSource() == CommentTrigger {
return nil, t.handleError(ErrNoChangesDetected, "")
log.Error().Err(ErrNoChangesDetected)
t.postUpdate(ErrNoChangesDetected.Error())
return nil, nil

} else {
log.Debug().Msg("No Terraform changes found in changeset.")
Expand Down Expand Up @@ -416,9 +418,8 @@ func (t *TFCTrigger) TriggerCleanupEvent() error {
t.handleError(err, "Error removing locking tag from workspace")
continue
}
wsNames = append(wsNames, cfgWS.Name)
}
// record workspace even if there are not tags since we could have cleared them earlier (same event can be called multiple times)
wsNames = append(wsNames, cfgWS.Name)
}
_, err = t.gl.CreateMergeRequestDiscussion(mr.GetInternalID(),
t.cfg.GetProjectNameWithNamespace(),
Expand Down

0 comments on commit 2071ecc

Please sign in to comment.