Skip to content

Commit

Permalink
clean pkg name
Browse files Browse the repository at this point in the history
  • Loading branch information
Chizkiyahu committed Oct 31, 2023
1 parent 3ae4fba commit 673e539
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clean_ghcr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import subprocess
import urllib.parse

import requests
import argparse
Expand Down Expand Up @@ -55,8 +56,9 @@ def get_req(path, params=None):

def get_list_packages(owner, repo_name, owner_type, package_name):
if package_name:
clean_package_name = urllib.parse.quote(package_name, safe='')
url = get_url(
f"/{owner_type}s/{owner}/packages/container/{package_name}")
f"/{owner_type}s/{owner}/packages/container/{clean_package_name}")
response = requests.get(url, headers=get_base_headers())
if not response.ok:
if response.status_code == 404:
Expand Down

0 comments on commit 673e539

Please sign in to comment.