bitrise-io / github-license-collector

GitHub License Collector: collect all licenses used in repos of a GH org and in all of the dependencies of those
MIT License
3 stars 2 forks source link

GitHub License Collector

Install:

go install github.com/bitrise-io/github-license-collector

Usage:

You have to set a GitHub Personal Access Token (https://github.com/settings/tokens - generate one with the full repo scope), so that the tool can access private repos of the specified org:

export GITHUB_PERSONAL_ACCESS_TOKEN='..Personal Access Token..'

Now you can run the collect command to collect all the repos of a specified GitHub Organization and then collect the licenses for all of those repos:

go install && github-license-collector collect --org=GitHubOrgName | tee log.txt

Requirements

Analyzers

This tool will run all analyzers under the /analyzers directory.

Each analyzer has a Detect logic in which it can decide if the given repository source is matching for the type it is looking for. The detected phase's description can be found in each analyzer's readme.

Also all analyzer have an AnalyzeRepository logic which will try to fetch all the dependencies from the project and searches for its license type. They way it reads the list of dependencies is documented in the analyzers readme.