Skip to main content

Publish Markdown documentation from GitHub to Confluence Cloud or Data Center

Project description

confluence-publisher

PyPI version Python versions Licence: MIT

A one-way publishing pipeline that syncs GitHub Markdown files to Confluence pages.

GitHub is the source of truth. Confluence is the generated presentation layer.


Quick start

  1. Add a confluence-manifest.yaml to your repository root.
  2. Copy an example workflow from examples/workflows/ into .github/workflows/.
  3. Add the three required secrets/variables to your repository settings.
  4. Push or trigger manually — pages appear in Confluence within minutes.

See docs/ONBOARDING.md for a full step-by-step guide.

# confluence-manifest.yaml
defaults:
  space_id: ENG
  parent_id: '123456'

pages:
  docs/architecture.md:
    title: Architecture Overview
    page_id: '234567'         # existing Confluence page ID
  docs/runbook.md:
    title: Operations Runbook # no page_id — auto-created on first publish
# .github/workflows/publish-to-confluence.yml (minimal)
- uses: pipewell/confluence-publisher@v1
  with:
    confluence-base-url: ${{ vars.CONFLUENCE_BASE_URL }}
    confluence-api-token: ${{ secrets.CONFLUENCE_API_TOKEN }}
    confluence-email: ${{ vars.CONFLUENCE_EMAIL }}

What it does

  • Triggers on push to main when files under docs/**/*.md change
  • Converts Markdown to Confluence Storage Format using a custom mistletoe renderer
  • Manages page identity via a checked-in YAML manifest (page IDs, not titles)
  • Auto-creates pages when page_id is absent; writes the new ID back via a [skip ci] commit
  • Uploads local images and Mermaid diagrams as page attachments
  • Detects edit conflicts (Confluence version ahead of last published) and warns or fails
  • Stores the Git commit SHA in the Confluence version message for traceability
  • Treats missing images, Mermaid render failures, and upload errors as hard build failures

Failure semantics

All failures exit non-zero. There are no silent failures.

Failure Behaviour
Markdown conversion error Build fails; page not published
Local image not found on disk Build fails; page not published (pre-flight check)
mmdc not installed with Mermaid diagrams present Build fails; page not published
Mermaid render failure Build fails; page not published
Confluence API error on create or update Build fails; manifest unchanged
Attachment upload failure on a new page Build fails; placeholder body stays in Confluence; page_id written to manifest; next push retries via the update path (no duplicate page created)
Attachment upload failure on an existing page Build fails; page body not updated; manifest hash unchanged; next push retries
Manual edit conflict Warning logged; page overwritten with GitHub content. --strict-conflicts makes this a build error while still overwriting

The "Commit manifest state" step uses if: always() so page_id values are committed to the repo even when the publish step exits non-zero, preserving the retry guarantee across CI runs.


Supported Markdown

Feature Support
Headings H1-H6 Full
Bold, italic, inline code Full
Fenced code blocks with language label Full
Tables Full
Ordered and unordered lists (including nested) Full
Blockquotes Full
Horizontal rules Full
External links Full
Internal links between managed .md files Resolved to Confluence page links
Local images Uploaded as page attachments
External images Rendered inline
Mermaid diagrams Rendered to PNG via mmdc (requires Node in CI)
Strikethrough Not supported -- raises a conversion error
Raw HTML Not supported -- raises a conversion error

Scope

This tool is intentionally narrow:

  • One-way only. It does not sync Confluence edits back to GitHub.
  • Not a real-time mirror. It runs on push and on a nightly validation schedule.
  • Not a general-purpose renderer. It targets the Confluence Storage Format features needed for engineering documentation.

Documents

Document Purpose
ONBOARDING Step-by-step guide for connecting a new repository
MANIFEST_SPEC Full manifest format reference
ARCHITECTURE System design and component breakdown
DECISIONS Decision log with rationale
BRD Business requirements and success metrics
TRD Technical requirements and API reference
DELIVERY_PLAN Phased delivery history

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipewell_confluence_publisher-1.0.1.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipewell_confluence_publisher-1.0.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file pipewell_confluence_publisher-1.0.1.tar.gz.

File metadata

File hashes

Hashes for pipewell_confluence_publisher-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2777a3161c4da7b38065b1b92feaf9a7aa73bfcb9a09982363232dbd9edd6a31
MD5 393d8ff5202d4116dd963c708b606ad6
BLAKE2b-256 921abfa2f4cbc6a6e97757e6ab73786d313b7cd82929a648dcc1852b3fa932c5

See more details on using hashes here.

File details

Details for the file pipewell_confluence_publisher-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pipewell_confluence_publisher-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4af065a7594d51d6d9a1529a45f73564317fbbbddcb6b9383cfeeddcb284de60
MD5 e9e19e3bd2eb66c60616a243b8ce340a
BLAKE2b-256 e16e185d7168bfc65cd31485ca4cbb8d1b0535c7bfac17e33e532e736ffd4b73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page