Skip to content

feat: enhance publish-to-confluence with frontmatter write-back, code macros, and reliability fixes#15

Open
orangit-timo-aho wants to merge 1 commit into
mainfrom
feat/publish-to-confluence-canonical
Open

feat: enhance publish-to-confluence with frontmatter write-back, code macros, and reliability fixes#15
orangit-timo-aho wants to merge 1 commit into
mainfrom
feat/publish-to-confluence-canonical

Conversation

@orangit-timo-aho
Copy link
Copy Markdown

@orangit-timo-aho orangit-timo-aho commented May 7, 2026

Summary

Significantly improves the publish-to-confluence action with new features, reliability fixes, and expanded format support.

Changes

Frontmatter write-back (confluence_url + page_id)

After a successful publish, the source .md file gains confluence_url and page_id in its YAML frontmatter. Eliminates hunting for the Confluence page after a push; enables downstream CI steps and Jira links to reference the exact page without a title search.

Code block → Confluence macro

Fenced code blocks are converted to ac:structured-macro code blocks with syntax highlighting (30+ language aliases) and line numbers. Previously published as unstyled <pre> text.

Direct REST PUT for page updates

Replaces conf.update_page() with a manually constructed PUT that includes the space key Confluence Cloud requires. Eliminates sporadic 400 ApiValueError failures that left runs partially complete.

Ghost page cleanup

On title conflict during create, the script searches across draft/trashed/archived statuses, deletes the blocking ghost page, and retries. Previously required manual intervention in Confluence UI to clear the conflict.

Space-wide folder title fallback

get_or_create_folder_page now falls back to a space-wide title search if the folder page is not found among the parent's children. Prevents duplicate folder pages on partial re-runs or across workflow instances.

Multi-format image upload

Image attachments now support .svg, .gif, .webp, .jpg, .bmp, .ico in addition to .png with correct MIME types.

Redundant index.md deduplication

foo/index.md is skipped when foo.md exists at the same level, preventing duplicate Confluence pages for the same section.

Selective publish (files= parameter)

publish_docs() accepts an optional files list, enabling workflows where only changed .md files are published per push.

Mermaid integration

Mermaid rendering via mmdc is fully encapsulated per-file. PNG attachments are converted to ac:image macros before the generic image handler runs. Blocks that mmdc cannot render fall through to the CloudScript macro fallback.

Merged features from template/publish-to-confluence into platform-tooling
to establish platform-tooling as the canonical action going forward.

## Frontmatter write-back (confluence_url + page_id)
After a successful publish, the source .md file gains confluence_url and
page_id in its YAML frontmatter. Eliminates hunting for the Confluence page
after a push; enables downstream CI steps and Jira links to reference the
exact page without a title search.

## Code block -> Confluence macro
Fenced code blocks are converted to ac:structured-macro code blocks with
syntax highlighting (30+ language aliases) and line numbers. Previously
published as unstyled <pre> text.

## Direct REST PUT for page updates
Replaces conf.update_page() with a manually constructed PUT that includes
the space key Confluence Cloud requires. Eliminates sporadic 400 ApiValueError
failures that left runs partially complete.

## Ghost page cleanup
On title conflict during create, the script searches across draft/trashed/
archived statuses, deletes the blocking ghost page, and retries. Previously
required manual intervention in Confluence UI to clear the conflict.

## Space-wide folder title fallback
get_or_create_folder_page now falls back to a space-wide title search if the
folder page is not found among the parent's children. Prevents duplicate folder
pages being created on partial re-runs or across workflow instances.

## Multi-format image upload
Image attachments now support .svg, .gif, .webp, .jpg, .bmp, .ico in addition
to .png, with correct MIME types. SVG diagrams from draw.io and other formats
previously failed silently and appeared broken in Confluence.

## Redundant index.md deduplication
foo/index.md is skipped when foo.md exists at the same level, preventing
duplicate Confluence pages (e.g. 'Adr' and 'Adr - Overview') for the same section.

## Selective publish (files= parameter)
publish_docs() accepts an optional files list. Enables a future workflow
pattern where only changed .md files are published per push, reducing
Confluence API calls and workflow runtime significantly.

## Mermaid integration (Option B - per-file pipeline)
Mermaid rendering via mmdc is now fully encapsulated in publish_single_file.
PNG attachments from render_mermaid_diagrams are converted to ac:image macros
via a dedicated _replace_mermaid_img_tags helper before the generic image
handler runs. Blocks that mmdc cannot render fall through to the CloudScript
macro fallback.
@orangit-timo-aho orangit-timo-aho changed the title Merge template publish features into canonical platform-tooling action feat: enhance publish-to-confluence with frontmatter write-back, code macros, and reliability fixes May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant