Closed rgreinho closed 2 years ago
When using chain-bench to audit repositories which do not belong to an organization, the process failed.
As a user I expected the tool to work in a similar way for repositories that do not belong to an organization.
The audit did not start due to 404 errors being returned since the repository was not part of an organization.
./chain-bench scan --repository-url https://github.com/rgreinho/trauma --access-token $GITHUB_TOKEN -o ./results 2022-06-17 09:08:59 INF 🚩 Fetch Starting 2022-06-17 09:09:00 ERR error in fetching organization error="GET https://api.github.com/orgs/rgreinho: 404 Not Found []" 2022-06-17 09:09:00 INF 🏢 Fetching Organization Settings Finished 2022-06-17 09:09:01 INF 🛢️ Fetching Repository Settings Finished 2022-06-17 09:09:01 INF 🌱 Fetching Branch Protection Settings Finished 2022-06-17 09:09:01 ERR error in fetching members error="GET https://api.github.com/orgs/rgreinho/members: 404 Not Found []" 2022-06-17 09:09:01 ERR Failed to fetch client data error="GET https://api.github.com/orgs/rgreinho/members: 404 Not Found []" Error: GET https://api.github.com/orgs/rgreinho/members: 404 Not Found []
The type of repository (e.g.: User or Organization) could be determined by querying the repo with the Get A Repository endpoint and used to adjust next requests:
User
Organization
$ curl -sL https://api.github.com/repos/rgreinho/trauma| jq .owner.type "User"
@morwn this feature will be nice! +1
Description
When using chain-bench to audit repositories which do not belong to an organization, the process failed.
What did you expect to happen?
As a user I expected the tool to work in a similar way for repositories that do not belong to an organization.
What happened instead?
The audit did not start due to 404 errors being returned since the repository was not part of an organization.
Additional details (base image name, container registry info...)
Implementation ideas
The type of repository (e.g.:
User
orOrganization
) could be determined by querying the repo with the Get A Repository endpoint and used to adjust next requests: