How to pull markdown content from Github feature/non-default branches

This article explains how to fetch the markdown content from Github feature/non-default branches and display it on the confluence page using the Markdown from URL macro.

Instructions

  1. Log in to Jira as an Administrator to configure the Markdown app.
  2. Under Manage Apps → Markdown for Confluence, click Configure.
  3. Navigate to Profiles → Add profile.
  4. Give a Profile name and select the Profile type as Github.
  5. Specify the URL as:

  6. Pass the Username and Access token of the Github account.
    Note: Refer to this document for generating access tokens: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token



  7. Click on Save Profile.
  8. Now, navigate to the page where the macro Markdown from a URL is used or Insert the macro to configure it.
  9. Click on the macro to edit it and pass the profile name (that is created through the above steps) in the profile parameter.
  10. Within the URL to markdown file parameter, pass the value in the given format to display the markdown content from feature branch or non-default branches:
    Format:

    /{owner}/{repo}/contents/{file-path}?ref={branch}

    Sample path:

    /kinnera-siriki/KS_test/contents/featurebranchmarkdown?ref=test-1





  11. Publish the page to see the results of the markdown file.


Make sure the Profiles are added to the Allowlist under the Markdown configuration if the URLs are restricted within Global Configuration.