Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pkgs-delete.yml #920

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/pkgs-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}"
headers = {"X-MyGet-ApiKey": api_key}
response = requests.delete(delete_url, headers=headers)
url = f"https://www.myget.org/F/{feed}/api/v2/package/{package_name}/{ver}"
shargon marked this conversation as resolved.
Show resolved Hide resolved
headers = {"X-NuGet-ApiKey": api_key}
response = requests.delete(url, headers=headers)
return response.status_code == 204 # 204 No Content, success

feed = os.environ['MYGET_FEED']
Expand Down
Loading