Usage
SCM-Contributors-Count Modes and Levels
General command
<command>
is one of:
azure-devops
bitbucket-cloud
bitbucket-server
github
github-enterprise
gitlab
consolidateResults
<command-options>
: see SCM-specific pages (example pages) in the scripts section.
Modes
Scoping usage prior to onboarding
This mode works only with Bitbucket and Azure.
Apply the skipSnykMonitoredRepos
flag, for example:
Snyk license consumption
This mode works only with Bitbucket and Azure.
Make sure to export your SNYK_TOKEN
, for example:
Levels
Top level
In this level of usage, the tool starts from the top of the SCM to get the Orgs/Groups, then goes down to the repo level to get all the repos, then counts the commits for the past 90 days.
To use this level, provide the credentials (and host/url where applicable), and the tool will get the contributors count for all your orgs/groups and all their repos, for example:
Mid level
In this level of usage, the tool starts from the Orgs/Groups that the user provides, then goes down to the repo level to get all the repos, then count the commits for the past 90 days.
To use this level, provide the credentials and a comma-separated list of groups or orgs for which you'd like to fetch the repos and their contributors count, for example:
Low level
In this level of usage, the tool focuses on only one repo for which to get the contributors count.
To use this level, provide the credentials (host/url where applicable), one org/group, and one repo, for example:
Debug mode
Add DEBUG=snyk*
to the beginning of the command, for example:
Additional optional flags
Additional flags can be set for the command:
Create an import file with unmonitored repos data to use with the
snyk-api-import
tool and import the repos tomy Snyk account
. Works only with Bitbucket and Azure. Apply theimportConfDir
flag with a path to a valid and writable folder where you will save the import files. This flag correlates with theimportFileRepoType
flag.Choose which types of repos to add to the import file. Works only with Bitbucket and Azure. Apply the
importFileRepoType
flag with one of these options:all,
private
, orpublic
.Exclude committers from being counted. Apply the
exclusionFilePath
flag to the command with a path to a text file that contains the emails of the committers that you would like to be excluded from the count.Output the summary and results in a json format. Apply the
json
flag to the command.
The consolidateResults command
Used for consolidating results from several commands across different SCMs, into a single file with unique contributors count. Refer to the command page.
Last updated