From 06c3afef251b40a9527927bc9788313f4b23a1fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Thu, 12 Mar 2026 23:04:33 +0100 Subject: [PATCH] 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> --- mark.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mark.go b/mark.go index ff41dfa..6a36f1a 100644 --- a/mark.go +++ b/mark.go @@ -390,8 +390,10 @@ func ProcessFile(file string, api *confluence.API, config Config) (*confluence.P } } - if err := updateLabels(api, target, labels); err != nil { - return nil, err + if meta != nil { + if err := updateLabels(api, target, labels); err != nil { + return nil, err + } } if config.EditLock {