fix: skip label sync when metadata is absent

When PageID mode is used (meta == nil), labels is nil and calling
updateLabels unconditionally treats that as an empty desired set,
silently removing all existing global labels from the page. Guard
the call so label syncing only runs when metadata is present.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Manuel Rüger 2026-03-12 23:04:33 +01:00
parent e68a9f64ff
commit 06c3afef25

View File

@ -390,9 +390,11 @@ func ProcessFile(file string, api *confluence.API, config Config) (*confluence.P
} }
} }
if meta != nil {
if err := updateLabels(api, target, labels); err != nil { if err := updateLabels(api, target, labels); err != nil {
return nil, err return nil, err
} }
}
if config.EditLock { if config.EditLock {
log.Infof( log.Infof(