aquasecurity / chain-bench

An open-source tool for auditing your software supply chain stack for security compliance based on a new CIS Software Supply Chain benchmark.
Apache License 2.0
712 stars 63 forks source link

Fix issue with get repo info #130 #132

Closed codekuu closed 8 months ago

codekuu commented 8 months ago

Description

Issue when the sub group has the same name as the repository. The getRepoInfo function does not parse it out correctly.

This fixes this issue.

Example url: https://my-gitlab-instance.com/top-group/sub-group/repo-name/repo-name getRepoInfo returned before:

host: my-gitlab-instance.com
namespace: top-group/sub-group
repo: repo-name
err: %!s(<nil>)

it now returns:

host: my-gitlab-instance.com
namespace: top-group/sub-group/repo-name
repo: repo-name
err: %!s(<nil>)

Related issues

Checklist

codekuu commented 8 months ago

LGTM, accepted the changes, added for github as well since It was the same problem their if a org had the same name as repo.

morwn commented 8 months ago

LGTM, accepted the changes, added for github as well since It was the same problem their if a org had the same name as repo.

Hi, I don't see the tested you added for github

codekuu commented 8 months ago

LGTM, accepted the changes, added for github as well since It was the same problem their if a org had the same name as repo.

Hi, I don't see the tested you added for github

You are right, your changes did override them. Do you want me to add them again or should we ignore them?