@@ -10,10 +10,9 @@ REPO_OWNER="${GITHUB_REPOSITORY_OWNER:-eclipsevortex}"
1010REPO_NAME=" subvortex-${COMPONENT// _/ -} "
1111IMAGE=" ghcr.io/$REPO_OWNER /$REPO_NAME "
1212
13- GHCR_USERNAME=" ${GHCR_USERNAME:- } "
14- GHCR_TOKEN=" ${GHCR_TOKEN:- } "
13+ GH_TOKEN=" ${GH_TOKEN:- } "
1514
16- if [[ -z " $GHCR_USERNAME " || -z " $GHCR_TOKEN " ]]; then
15+ if [[ -z " $GH_TOKEN " ]]; then
1716 echo " ❌ Missing Docker credentials (GHCR_USERNAME / GHCR_TOKEN)"
1817 exit 1
1918fi
@@ -22,7 +21,6 @@ echo "🔍 Searching for Version ID corresponding to tag: $VERSION..."
2221
2322# Step 1: Find the Version ID from the tag
2423VERSION_ID=$( gh api " user/packages/container/${REPO_NAME} /versions" \
25- -H " Authorization: Bearer $GHCR_TOKEN " \
2624 | jq -r --arg VERSION " $VERSION " " .[] | select(.metadata.container.tags[]? == \" $VERSION \" ) | .id" )
2725
2826if [[ -z " $VERSION_ID " ]]; then
@@ -36,7 +34,7 @@ echo "🔍 Found Version ID: $VERSION_ID"
3634echo " 🗑️ Deleting $IMAGE :$VERSION (Version ID: $VERSION_ID ) from GitHub Container Registry..."
3735
3836RESPONSE=$( curl -s -o /dev/null -w " %{http_code}" -X DELETE \
39- -H " Authorization: Bearer $GHCR_TOKEN " \
37+ -H " Authorization: Bearer $GH_TOKEN " \
4038 -H " Accept: application/vnd.github.v3+json" \
4139 " https://api.github.com/user/packages/container/${REPO_NAME} /versions/${VERSION_ID} " )
4240
0 commit comments