GITHUB

The Github to Roam Integration allows users to import various types of data from Github and bring into their Roam Database.

Installation

You could use the Copy Extension button below to individually install this extension. To install, just paste anywhere in your Roam graph and click "Yes, I Know What I'm Doing".

Manual Installation

If the extension doesn't work after using the copy extension button above, try installing manually using the instructions below.

First create a block with the text {{[[roam/js]]}} on any page in your Roam DB. Then, create a single child of this block type three back ticks. A code block should appear. Copy this code and paste it into the child code block in your graph:

var existing = document.getElementById("roamjs-github");
if (!existing) {
  var extension = document.createElement("script");
  extension.src = "https://roamjs.com/github.js";
  extension.id = "roamjs-github";
  extension.async = true;
  extension.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(extension);
}

Finally, click "Yes, I Know What I'm Doing".

Usage

The script supports the following configuration attributes, to be added in the [[roam/js/github]] page:

  • Username - (Optional) By default, the extension calls the api with my username and token. If you would like to make calls under your username, set this attribute with token below. This give you access to your private data and is called straight from the Roam frontend.
  • Token - (Optional) Set with Username above to call GitHub's api as another user. See this page for documentation on how to create a personal access token. The token must have repo scope access.

To add a configuration attribute, use the double colon after the configuration name, followed by the configuration value:

GitHub Issues

To query your issues, you will need to specify both the username and token configuration options above. Otherwise, this button will query issues from dvargas92495.

In any page, create a Import Github Issues button by typing in {{import github issues}} (case-insensitive) in a block. Upon clicking the button, the extension will clear the button and fill the page in with the issues you have assigned to you in the following format:

[title](html link)

GitHub Repos

In any page, create a Import Github Repos button by typing in {{import github repos}} (case-insensitive) in a block. Upon clicking the button, the extension will clear the button and fill the page in with the repos that you have in your account as new pages with the repo name as the title. By default it will use the Username attribute configured in the config page. To override this to query someone else's publicly available repos, you could add for {username} to the button text. For example, {{import github repos for dvargas92495}}.

GitHub Projects

In any page, create a Import Github Projects button by typing in {{import github projects}} (case-insensitive) in a block. Upon clicking the button, the extension will clear the button and fill the page in with the projects that you have in your account as new pages with the project name as the title. By default it will use the Username attribute configured in the config page and the name of the page as the repo name. To override this to query someone else's publicly available repos, you could add for {username} in {name} to the button text. For example, {{import github projects for dvargas92495 in roam-js-extensions}}.

GitHub Cards

In any page, create a Import Github Cards button by typing in {{import github cards}} (case-insensitive) in a block. Upon clicking the button, the extension will clear the button and fill the page in with the card notes from the project you specify. By default it will use the Username attribute configured in the config page, the name of the page as the project name, and the first linked reference as the repo name. To override this, you could add any part of for {username} in {name} under {project} as {column} to the button text. For example, {{import github projects for dvargas92495 in roam-js-extensions under "Github Integration" as "To do"}} in the Github Integration page will grab the cards under the To do in that project. Note that if values themselves have spaces, they need to be surrounded by quotes.

Demo

Contributors

This extension is brought to you by RoamJS! If you are facing any issues reach out to support@roamjs.com or click on the chat button on the bottom right. If you get value from using this extension, consider sponsoring RoamJS by clicking on the button below!

ROAMJS DIGEST

Add your email below to stay up to date on all RoamJS features, fixes, and news!

Other Extensions