Skip to main content

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 }}

Using a fine-grained/scoped Atlassian API token? See docs/ONBOARDING.md — these are rejected on the direct tenant domain and need confluence-cloud-id set instead.


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
  • Adds an auto-generated banner to each page (source file, commit SHA, tool attribution) -- configurable via defaults.attribution in the manifest or --no-attribution
  • Best-effort preserves inline comment anchors across republish, when the commented text is unchanged (see "Known limitations")
  • 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.

Known limitations

  • Inline comments can lose their anchor on republish, depending on what changed. Confluence anchors an inline comment by embedding markup directly in the page body around the highlighted text, and every publish replaces the full page body with freshly-converted Markdown. Since v1.3.0, the tool re-anchors a comment automatically if the exact commented text still appears, unchanged and unambiguous, in the new body -- confirmed working via live testing against real Confluence pages. If the commented text was reworded, moved into a context that makes it ambiguous (appears more than once), or the comment was on formatted text (e.g. specifically on bold/italic, not the whole line), the anchor still doesn't survive -- the comment thread is typically detached rather than deleted, but no longer points at any specific text. Footer/page-level comments are unaffected either way, since they're stored separately from the body and never touched by this tool. Background in #11.

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

Metadata

Release files for pipewell-confluence-publisher 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipewell-confluence-publisher 1.3.0
File Size Uploaded
pipewell_confluence_publisher-1.3.0.tar.gz 33.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipewell-confluence-publisher 1.3.0
File Interpreter ABI Platform
pipewell_confluence_publisher-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.9 kB

Release files / pipewell_confluence_publisher-1.3.0.tar.gz

Download URL pipewell_confluence_publisher-1.3.0.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
96647753e563c8f25bc6729065c324570d8586ce007ea2af83caf166c3cb9a6c
BLAKE2b-256 checksum
How to use checksums
84d0722a347267d49dd3a71a7b8a7776f4124cfe4b2de7741d92666fcf2f2c5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / pipewell_confluence_publisher-1.3.0-py3-none-any.whl

Download URL pipewell_confluence_publisher-1.3.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78a73bedc8c887c2397fd54b705debfe593e20b8858a98f2624aab824733ea3c
BLAKE2b-256 checksum
How to use checksums
e113bea400b66e2a09650618aa8eb18974ac33a79fb51be17ce43069301819bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page