diff --git a/pkg/tfc_trigger/tfc_trigger.go b/pkg/tfc_trigger/tfc_trigger.go index 0c5baf1..a4da8b6 100644 --- a/pkg/tfc_trigger/tfc_trigger.go +++ b/pkg/tfc_trigger/tfc_trigger.go @@ -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.") @@ -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(),