Skip to content

andygolubev/github-to-confluence-publisher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub to Confluence Publisher

This repository contains a script that allows you to publish Markdown files from GitHub to Confluence. The script automates the process of converting Markdown files to Confluence markup and uploading them to your Confluence space.

Link to my article: https://dev.to/andygolubev/automate-publishing-markdown-files-from-github-to-confluence-with-github-to-confluence-publisher-tool-eh4

Setup

Create new domain in Confluence cloud

Create new cloud domain here https://my.atlassian.com/product

Create new Space, a Parent page and API Token

You should create a Space and copy it's name from the URL (in my case: "Documentat". The full url is https://test-publisher.atlassian.net/wiki/spaces/Documentat/) Create a new page and copy it's id. (in my case: "262359". the full url is https://test-publisher.atlassian.net/wiki/spaces/Documentat/pages/262359/Documentation+from+the+github)

Create new API key here https://id.atlassian.com/manage-profile/security/api-tokens

Configure the publisher in publisher/config/config.yaml

Replace this values with your values

confluence_url: https://test-publisher.atlassian.net/wiki/rest/api/

confluence_space: Documentat 
counfluence_parent_page_id: 262359
confluence_search_pattern: (this page is autogenerated)
github_folder_with_md_files: ./data
github_folder_with_image_files: ./data_images

I use "confluence_search_pattern:" to find autogenerated pages and delete it each run. I recommend to use some random value like "(this page is autogenerated FGWSDF)"

Setup a pipeline (example is provided in the github workflows folder)

Create you secrets and setup your pipeline. Confluence expect you e-mail as a login and a API Key as a password.

How it works

Your confluence space is empty.

space

Then you run the publisher and it search for the pages with "confluence_search_pattern" from the config. Then it deletes all the found pages.

local run local run or github actions github

Then you can see that you parent page containes child pages with your content

structure

All the images were poster as attachements for the pages.

attachements

The pages that imitates the folder contains the "Children Display" widget.

widget

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages