Skip to content

Commit

Permalink
Update compliance_check.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Notradame authored Jun 8, 2024
1 parent a6185cc commit 6f023e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compliance_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ def save_compliance_report(issues, output_file):
def convert_github_url_to_api(url):
if not url.startswith("https://github.com/"):
raise ValueError("Invalid GitHub URL")
repo_path = url[len("https://github.com/"):]
return f"https://api.github.com/repos/{repo_path}/contents/"
repo_path = url[len("https://github.com/"):].split('/')
assert len(repo_path) >= 2, "Looks like an invalid repo"
return f"https://api.github.com/repos/{repo_path[0]}/{repo_path[1]}/contents/"

def main(repo_url, directory="temp"):
download_files(repo_url, directory)
Expand Down

0 comments on commit 6f023e4

Please sign in to comment.