---
title: "Configuring Github Macros for Confluence (Server)"
canonical: "https://support.appfire.com/space/GMFC/150241289/Configuring%20Github%20Macros%20for%20Confluence%20(Server)"
format: markdown
---
> Macro (aura-html)

> ⚠️ Are you planning to migrate to Cloud? Make sure you do not lose your data/configurations in the process. Check out the [Migration guide](https://appfire.atlassian.net/wiki/x/aYD0C) for information on how to migrate the app’s data to Cloud. Contact our [support team](https://appfire.atlassian.net/servicedesk/customer/portal/11) if you have any questions.

## Macro to include code snippets, files, issues and more from GitHub into Confluence  
  
Features

- Include and render markdown files from GitHub into Confluence.
- Include issue lists from GitHub into Confluence.
- Include pull request lists from GitHub into Confluence.
- Support for both private and public repositories.

## Configuration

> ⚠️ Once a GitHub token is configured, all Confluence users will have access to it when using the macros. This means that the contents of private repositories will be accessible to all Confluence users.

### **Use tokens to resolve images and links in Markdown files**<span style="color: #172b4d">** **</span>

If enabled, macro use tokens with GitHub API to render private images and links in Markdown from your private GitHub repositories. Note, that GitHub has a [limit for API calls](https://docs.github.com/en/developers/apps/building-github-apps/rate-limits-for-github-apps), so if your page with GitHub Macro has thousands of views, you may exceed the hourly API call limit of your token.

### **Register a new personal access token**

> ℹ️ You will need a personal access token from GitHub to configure the plugin for the server. [Create a personal access token here](https://github.com/settings/tokens).

Once you have obtained a personal access token, click **Add new token** on the plugin configuration page. 

![image](media://d21cfe83-ac0b-46a0-b64e-d4c411f306d7)

A configuration dialog appears. Enter your **Username** and personal access **Token** here. If you are using GitHub Enterprise, you can also add the optional **URL** for your own GitHub server. Once you are done, click **Add**.

![image](media://3b7f0f76-4a6a-4f55-9434-1691988adb4b)

  


### **Limit the number of lines (Optional)**

If you want to display only certain lines of code, specify the limit of the code lines to be displayed. Leave this parameter blank to display complete code lines.  Or, you can specify a range or the number of maximum lines to be displayed. For example: `5`, `2-25`.

> ℹ️ - This parameter is applicable only for the *GitHub file* macro.* *
> ℹ️ - The global configuration parameter* Limit the number of Lines* is the default value for the macro parameter *Lines of code* of a new macro.
> ℹ️ - You can specify the* Lines of code* macro parameter within each macro, and this takes precedence over the *Limit the number of Lines* specified in the global configuration.
> ℹ️ - You can hide the line numbers displayed in the code block. To hide the line numbers, go to the *GitHub file macro* and select the *Hide line numbers of code block *checkbox.

You are now ready to get started with the macro! 

<span style="color: #172b4d">Refer to the </span><span style="color: #008000">[Macros](https://appfire.atlassian.net/wiki/x/-AYUKg)</span><span style="color: #008000"> </span><span style="color: #172b4d">page to learn more about the macros.</span>