sposmen / gh_pr_tree_render

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Github Pull Request hierarchy tree renderer

Pre-Requisites

Install dependencies

Run yarn to install dependencies

Configure

Env variables

Copy .env.example as .env and set the environment configurations accordingly. The only required one is GITHUB_ACCESS_TOKEN that could be created through https://github.com/settings/tokens and could be also set in your sh/bash/zsh configuration files as export option.

Repos config

Set your repositories configurations in repositories.json

{
  "GITHUB_USER": {
    "REPO_NAME": [{
      "mainBranch": "BRANCH_TO_RENDER",
      "ignored": []
    }],
    "REPO_NAME2": [{
      "mainBranch": "master",
      "ignored": []
    }]
  }
}
  • REPO_NAME: Can contain multiple hierarchies (array) to create them in a single call.
  • mainBranch: is the branch you want to hierarchy render. All parents and leafs will happen based on it. If it is not set all PR's will be part of it
  • ignored are those full links strings array that must be ignored to avoid unwanted PR's.

Note: All dependabot* named branches are ignored by default.

Run

node run.js

Result

The result will be a svg file based on the graphs/<GITHUB_USER>.<REPO_NAME>.<MAIN_BRANCH>.pr_tree.svg path that could be open in browser

Final SVG example

Image Result

About


Languages

Language:JavaScript 99.9%Language:HTML 0.1%