From 833abf2ecae92b392fa82a0c1a5998b5c32a4b64 Mon Sep 17 00:00:00 2001 From: Shargon Date: Tue, 20 Feb 2024 05:12:32 -0800 Subject: [PATCH 1/3] Update pkgs-delete.yml --- .github/workflows/pkgs-delete.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pkgs-delete.yml b/.github/workflows/pkgs-delete.yml index e86fc0f71..98506b8b7 100644 --- a/.github/workflows/pkgs-delete.yml +++ b/.github/workflows/pkgs-delete.yml @@ -32,7 +32,7 @@ jobs: import os def get_versions(feed, package_name, api_key): - url = f"https://www.myget.org/F/neo/api/v2/Packages?$filter=Id eq '{package_name}'&$format=json" + url = f"https://www.myget.org/F/{feed}/api/v2/Packages?$filter=Id eq '{package_name}'&$format=json" headers = {'Accept': 'application/json'} response = requests.get(url, headers=headers) if response.status_code == 200: @@ -42,9 +42,9 @@ jobs: return [] def delete_version(feed, package_name, ver, api_key): - delete_url = f"https://www.myget.org/F/{feed}/api/v2/package/{package_name}/{ver}" + url = f"https://www.myget.org/F/{feed}/api/v2/package/{package_name}/{ver}" headers = {"X-MyGet-ApiKey": api_key} - response = requests.delete(delete_url, headers=headers) + response = requests.delete(url, headers=headers) return response.status_code == 204 # 204 No Content, success feed = os.environ['MYGET_FEED'] From 372522d206b41c96781d1dd6cfab38ffbc4a4987 Mon Sep 17 00:00:00 2001 From: Shargon Date: Tue, 20 Feb 2024 23:29:09 +0100 Subject: [PATCH 2/3] Update .github/workflows/pkgs-delete.yml --- .github/workflows/pkgs-delete.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgs-delete.yml b/.github/workflows/pkgs-delete.yml index 98506b8b7..99988b024 100644 --- a/.github/workflows/pkgs-delete.yml +++ b/.github/workflows/pkgs-delete.yml @@ -43,7 +43,7 @@ jobs: def delete_version(feed, package_name, ver, api_key): url = f"https://www.myget.org/F/{feed}/api/v2/package/{package_name}/{ver}" - headers = {"X-MyGet-ApiKey": api_key} + headers = {"X-NuGet-ApiKey": api_key} response = requests.delete(url, headers=headers) return response.status_code == 204 # 204 No Content, success From 6393339876ac74bf7eee63fbf02d04f90405b1d2 Mon Sep 17 00:00:00 2001 From: Shargon Date: Tue, 20 Feb 2024 23:33:17 +0100 Subject: [PATCH 3/3] Update .github/workflows/pkgs-delete.yml --- .github/workflows/pkgs-delete.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgs-delete.yml b/.github/workflows/pkgs-delete.yml index 99988b024..d2abe09b3 100644 --- a/.github/workflows/pkgs-delete.yml +++ b/.github/workflows/pkgs-delete.yml @@ -42,7 +42,7 @@ jobs: return [] def delete_version(feed, package_name, ver, api_key): - url = f"https://www.myget.org/F/{feed}/api/v2/package/{package_name}/{ver}" + url = f"https://www.myget.org/F/{feed}/api/v2/package/{package_name}/{ver}?hardDelete=true" headers = {"X-NuGet-ApiKey": api_key} response = requests.delete(url, headers=headers) return response.status_code == 204 # 204 No Content, success