Skip to content

Commit

Permalink
Change: Different try on iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielschowe committed Sep 18, 2024
1 parent 37bfb8d commit df2eabb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pontos/github/api/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def package(

async def package_versions(
self, organization: str, package_type: PackageType, package_name: str
):
) -> AsyncIterator[PackageVersion]:
"""
Get information about package versions
Expand Down Expand Up @@ -347,11 +347,8 @@ async def delete_package_with_tag(
tag="latest",
)
"""

async for version in self.package_versions(organization, package_type, package_name):
if version.tags == tag:
await self.delete_package_version(organization, package_type, package_name, version.version)
return
async for package_version in self.package_versions(organization, package_type, package_name):
print(package_version)
api = f"/orgs/{organization}/packages/{package_type}/{package_name}/versions/tags/{tag}"
response = await self._client.delete(api)
if not response.is_success:
Expand Down

0 comments on commit df2eabb

Please sign in to comment.