githubocto/repo-visualizer

Interactive Repo Visualizer and private repos

Opened this issue · 1 comments

This is a follow up to #20.

The Interactive Repo Visualizer tool is superior to the static SVG generation option.

It will be great to have it either open-sourced, released as part of the repo Insights (tab) on GitHub, or at least add official support for accessing private repos.


In the mean time, here are the instructions to get the current tool working with private repos:

  1. Go to https://github.com/settings/tokens

  2. Generate a new PAT with repo permissions

  3. Go to https://mango-dune-07a8b7110.1.azurestaticapps.net/

  4. Add the following code to the JS console replacing TOKEN with your GitHub PAT

    window.originalFetch = window.fetch;
    const modifiedFetch = (resource, init) => window.originalFetch(resource, { ...init, headers: { "Authorization": "Bearer 
    TOKEN" } });
    window.fetch = modifiedFetch;
  5. In the repository input, type any repository (public or private)

Kudos to @filipegiusti for posting the original instructions for private repo support.

I didn't realize it doesn't work with private repos. I spent half an hour trying to figure out why the job would suddenly stop showing up in the PR status just from adding uses: githubocto/repo-visualizer. I wish GitHub would have given me some kind of error instead of just having the job not appear as if it doesn't exist.