Go to file
2024-12-17 15:00:58 +01:00
src modified cloud to support both subdomains (*.atlassian.net) or actual domains (e.g. ame.jira.com) 2024-11-28 09:29:50 -05:00
.dockerignore update deps and optimize dockerfile 2022-12-08 15:57:33 +01:00
.gitignore load dotenv 2022-12-08 17:24:06 +01:00
action.yml cleanup 2022-12-08 16:00:30 +01:00
Dockerfile update deps and optimize dockerfile 2022-12-08 15:57:33 +01:00
LICENSE Create LICENSE 2020-12-13 16:34:22 +01:00
Pipfile load dotenv 2022-12-08 17:24:06 +01:00
Pipfile.lock load dotenv 2022-12-08 17:24:06 +01:00
README.md update readme to make it more clear 2024-11-28 09:34:59 -05:00

Confluence Markdown Sync Action

This Github Action serves the purpose of copying the contents of a Markdown .md file to a Confluence Cloud Page.

Getting Started

# .github/workflows/my-workflow.yml
on: [push]

jobs:
  dev:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: cupcakearmy/confluence-markdown-sync@v1
        with:
          from: './README.md'
          to: '123456' # The confluence page id where to write the output
          cloud: <my-confluence-cloud-id>
          user: <my.user@example.org>
          token: <my-token>

Authentication

Uses basic auth for the rest api.

  • cloud: Can be either:

    • A subdomain (acme for Atlassian hosted instances (e.g. https://acme.atlassian.net))
    • A full URL (e.g., https://mycompany.com for self-hosted instances)
  • user: The user that generated the access token

  • token: You can generate the token here. Link to Docs

  • to: The page ID can be found by simply navigating to the page where you want the content to be posted to and look at the url. It will look something like this:

    • For Atlassian hosted: https://<subdomain>.atlassian.net/wiki/spaces/<space>/pages/<page-id>/<title>
    • For self-hosted: https://<your-url>/wiki/spaces/<space>/pages/<page-id>/<title>

Using secrets

It's higly reccomended that you use secrets!

To use them you need them to specify them before in your repo. Docs

Then you can use them in any input field.

# .github/workflows/my-workflow.yml
# ...
token: ${{ secrets.token }}

Known Limitations

For now images will not be uploaded see ticket, they would require extra steps. If anyone feedls brave enough, constributions are welcomed :)

Development

  1. Clone the repo
  2. Install act
  3. Create the same config in the repo folder as in the getting started section above.
  4. Change uses: cupcakearmy/confluence-markdown-sync -> uses: ./
  5. Create an example markdown file Some.md and set it in the config from: './Some.md'
  6. Run locally act -b

With secrets

You can simply create a .secrets file and specify it to act.

TOKEN=abc123
# .github/workflows/dev.yml
# ...
token: ${{ secrets.token }}
act -b --secret-file .secrets