Skip to content

cx-happy-yang/cxone-scm-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CxOneImportGitHubProjects

This python script aims to import all GitHub repos from one GitHub Organization into CxOne.

Prerequisites for the script, you need to set the following environment variables

* GITHUB_ORG: your GitHub organization name, which is case-sensitive
* CXONE_GITHUB_AUTH_CODE: your GitHub auth code
* CXONE_ACCESS_CONTROL_URL: Your cxone IAM url: https://sng.iam.checkmarx.net/
* CXONE_SERVER: Your cxone server url, for example: https://sng.ast.checkmarx.net/
* CXONE_TENANT_NAME: Your cxone tenant name
* CXONE_GRANT_TYPE: refresh_token
* CXONE_REFRESH_TOKEN: Your CxOne API Key
* GITHUB_TOKEN: github personal access token

Two ways to import

  1. using the documented REST API : /api/repos-manager/scm-projects
  2. using oauth code, and using an undocumented REST API: /api/repos-manager/scms/1/orgs/{github_org}/asyncImport

Notice

Please use Python3!

How to run the script

  1. create a python virtual environment: python -m venv .venv
  2. activate the virtual environment: a. on Windows: ..venv\Scripts\activate b. on Linux/MacOS: source .venv/bin/activate
  3. install the dependencies: pip install -r requirements.txt
  4. update the auto_code in main.py. Please find the auth_code from CxOne Portal developer tools.
  5. run the python script: python main.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages