-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for self-hosted SCM #111
Conversation
Adds support for specifying an SCM for supporting self-hosted environments.
Matches the escaped name used in Github
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your contribution is very welcome, thanks!
I put some comments here, the main thing is to make this support an optional parameter, so it will not break the current behaviour
Co-authored-by: Mor Weinberger <morwnbrg@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please adjust the test here to support your fix around the project name
Description
This PR adds support for optionally specifying a SCM to support self-hosted environments. The change defaults to
github
for backwards compatibility but should support Gitlab or GitHub self-hosted/enterprise deployments on a custom domain.Before
chain-bench scan --repository-url <REPOSITORY_URL> --access-token <TOKEN> -o <OUTPUT_PATH>
After
chain-bench scan --repository-url <REPOSITORY_URL> --access-token <TOKEN> --scm-platform gitlab -o <OUTPUT_PATH>
Without SCM, chain-bench will fallback to Github SaaS -
chain-bench scan --repository-url <REPOSITORY_URL> --access-token <TOKEN> -o <OUTPUT_PATH>
Currently only tested on Gitlab but opening the PR early for discussion. The PR also includes a small fix for Gitlab querying protected branches where repo names don't match the escaped path.
Related issues
Checklist