Bitbucket Cloud - Examples
The list of options and some examples for Bitbucket Cloud
The following options are available for the snyk-scm-contributors-count bitbucket-cloud
command:
Before running the command
Export SNYK_TOKEN (if you want to get the contributors only for repos that are already monitored by Snyk):
Make sure that your token has Group level access or use a service account's token that has Group level access. To learn more about how to create a service account, refer to How to set up a service account.
Copy the token value.
Export the token in your environment:
Get your Bitbucket Cloud username (not email) and app password
Note: Make sure your credentials have read access to the repos.
Running the command
Consider the following levels of usage and options:
Usage levels
To get commits for all workspaces and their repos in Bitbucket Cloud, provide the Bitbucket Cloud user and app password:
To get commits for some workspaces and their repos in Bitbucket Cloud, provide the Bitbucket Cloud user, Bitbucket Cloud app password, and a comma-separated list of workspaces:
To get commits for a specific repo in Bitbucket Cloud, provide the Bitbucket Cloud user, Bitbucket Cloud app password, a workspace, and a repo name:
Options
To get all the commits from Bitbucket Cloud regardless of the repos that are already monitored by Snyk, add the
--skipSnykMonitoredRepos
flag. You might have repos in Bitbucket Cloud that are not monitored in Snyk; use this flag to skip checking for Snyk monitored repos and go directly to Bitbucket Cloud to fetch the commits.To exclude some contributors from being counted in the commits , add an exclusion file with the emails to ignore (separated by a new line),and apply the
--exclusionFilePath
with the path to that file:To set the output to json format: add the
--json
flag:To create an import file for your unmonitored repos, add the
--importConfDir
flag with a valid (writable) path to a folder in which the import files will be stored, and add the--importFileRepoType
flag (optional) with the repo types to add to the file (all
/private
/public
, defaults toall
). Note that these flags can not be set with the--repo
flag.For more information about these flags, refer to this Creating and using the import page.
To run in debug mode for verbose output, prefix with
DEBUG=snyk*
:
Last updated