From f53a18f2e2e49320a62bfe9998b200cf75558cb6 Mon Sep 17 00:00:00 2001 From: David Read <98895674+davidread-harbr@users.noreply.github.com> Date: Mon, 14 Mar 2022 15:28:24 +0000 Subject: [PATCH] Add details of getting GitHub token - particularly useful to know the scope needed --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3bb8076..eb24a0a 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ defaults + snyk code enable: `./snyk_scm_refresh.py --org-id=12345 --code=on` ## Dependencies ``` -pip install -r requirements.txt +pip install -r requirements.txt ``` or ``` @@ -82,6 +82,11 @@ If using the Snyk Github Enterprise Integration type for your Github.com reposit
+### Getting a GitHub token + +1. In GitHub.com browse: https://github.com/settings/tokens/new. Or in GitHub Enterprise select your user icon (top-right), then 'Settings', then 'Developer settings', then 'Personal access tokens'. +2. Scopes - Public repos do not need a scope. If you want to scan private repos, then you'll need to enable this scope: `repo` (Full control of private repositories) + ## Instructions Make sure to use a user *API Token* that has acess to the Snyk Orgs you need to process with the script. A service account will *not* work for GitHub, which is the only SCM currently supported at this time. @@ -89,9 +94,9 @@ Ensure that your GITHUB_TOKEN or GITHUB_ENTERPRISE_TOKEN has access to the repos If unsure, try one org at a time with `--org-id` -**Recommended:** +**Recommended:** This tool will delete projects from Snyk that are detected as stale or have since been renamed - + Use the `--dry-run` option to verify the execution plan for the first run Each run generates a set of output files: