This python script aims to import all GitHub repos from one GitHub Organization into CxOne.
* 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
- using the documented REST API : /api/repos-manager/scm-projects
- using oauth code, and using an undocumented REST API: /api/repos-manager/scms/1/orgs/{github_org}/asyncImport
Please use Python3!
- create a python virtual environment: python -m venv .venv
- activate the virtual environment: a. on Windows: ..venv\Scripts\activate b. on Linux/MacOS: source .venv/bin/activate
- install the dependencies: pip install -r requirements.txt
- update the auto_code in main.py. Please find the auth_code from CxOne Portal developer tools.
- run the python script: python main.py