From 310ccf4ef81fad53a8be1548c24725f21f2110dd Mon Sep 17 00:00:00 2001 From: Daniel von Atzigen Date: Wed, 30 Oct 2024 14:32:22 +0100 Subject: [PATCH] Fix failing cleanup job --- .github/scripts/remove-packages.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/remove-packages.js b/.github/scripts/remove-packages.js index 61a3f7df..c4896bc7 100644 --- a/.github/scripts/remove-packages.js +++ b/.github/scripts/remove-packages.js @@ -1,6 +1,6 @@ -const { Octokit } = require("@octokit/rest"); - const removePackageVersions = async (imageUrl, imageVersions) => { + const { Octokit } = await import("@octokit/rest"); + const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN, }); @@ -11,7 +11,7 @@ const removePackageVersions = async (imageUrl, imageVersions) => { await octokit.rest.packages.deletePackageVersionForOrg({ package_type: "container", package_name: imageName, - username: imageOwner, + org: imageOwner, package_version_id: imageId, }); } @@ -26,7 +26,7 @@ const loadOutdatedVersionIds = async (octokit, imageOwner, imageName, versions) const response = await octokit.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({ package_type: "container", package_name: imageName, - username: imageOwner, + org: imageOwner, page, }); if (response.data.length === 0) {