fix(ci): delete release asset with release id
All checks were successful
release / release (push) Successful in 12s
All checks were successful
release / release (push) Successful in 12s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -119,8 +119,8 @@ def _list_release_assets(api_base: str, token: str, release_id: int) -> list[dic
|
||||
return assets
|
||||
|
||||
|
||||
def _delete_asset(api_base: str, token: str, asset_id: int) -> None:
|
||||
url = f"{api_base}/releases/assets/{asset_id}"
|
||||
def _delete_asset(api_base: str, token: str, release_id: int, asset_id: int) -> None:
|
||||
url = f"{api_base}/releases/{release_id}/assets/{asset_id}"
|
||||
status, body = _request("DELETE", url, token)
|
||||
if status >= 400:
|
||||
_fail(f"failed to delete asset {asset_id}", status=status, body=body)
|
||||
@@ -213,7 +213,7 @@ def main(argv: list[str] | None = None) -> int:
|
||||
if asset.get("name") == args.asset_name:
|
||||
asset_id = int(asset["id"])
|
||||
print(f"Deleting existing asset {args.asset_name} (id={asset_id})...")
|
||||
_delete_asset(api_base, token, asset_id)
|
||||
_delete_asset(api_base, token, release_id, asset_id)
|
||||
|
||||
print(f"Uploading {file_path} as {args.asset_name}...")
|
||||
uploaded = _upload_asset(
|
||||
|
||||
Reference in New Issue
Block a user