From 31c4aa8228c19db632d3be15a1852e0fae6471c4 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Fri, 21 Aug 2026 08:22:59 +0200 Subject: [PATCH 1/2] gha: remove the clean-up for the staging image Removing the staging tag for the main branch, will cause the removal of the image which is renamed with the final tag. Keeping the staged tag is relatively harmless since it will then point to the final image, otherwise it will be overwritten in the next stage. In any case, we staged the image only on merged PR, hence we don't published untested image. Assisted-by: AI Signed-off-by: Alice Frosi --- .github/workflows/integration-tests.yml | 40 ------------------------- 1 file changed, 40 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0e9b3d8..322090e 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -440,43 +440,3 @@ jobs: sudo podman push ${PUSH_DEST}:latest-disk-composefs fi - cleanup-staged-images: - needs: - [ - supported-versions, - build-node-images, - integration-tests, - integration-tests-composefs, - integration-tests-k8s-versions, - push-node-images, - ] - # Only staged (push/workflow_dispatch) runs push anything to GHCR in the first - # place. Always run once every consumer has finished, regardless of whether - # they succeeded, failed, or were skipped. - if: always() && needs.build-node-images.result != 'skipped' && (github.event_name == 'push' || inputs.push-node-images == true) - runs-on: ubuntu-latest - permissions: - packages: write - steps: - - name: Delete staged bootc images from GHCR - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - OWNER=$(echo "${{ env.PUSH_REGISTRY }}" | cut -d'/' -f2) - PACKAGE="$(echo "${{ env.PUSH_REGISTRY }}" | cut -d'/' -f3)/${{ env.PUSH_IMAGE }}" - PACKAGE_ENC="${PACKAGE//\//%2F}" - BRANCH_TAG=${{ needs.supported-versions.outputs.branch-tag }} - - for kube_minor in $(echo '${{ needs.supported-versions.outputs.all-versions }}' | jq -r '.[]'); do - TAG="v${kube_minor}-fedora-${{ needs.supported-versions.outputs.fedora-version }}" - STAGING_TAG="${BRANCH_TAG}-${TAG}" - echo "Looking up staged image tag: ${STAGING_TAG}" - VERSION_ID=$(gh api "/orgs/${OWNER}/packages/container/${PACKAGE_ENC}/versions" --paginate \ - --jq ".[] | select(.metadata.container.tags[]? == \"${STAGING_TAG}\") | .id" | head -n1) - if [ -n "$VERSION_ID" ]; then - gh api --method DELETE "/orgs/${OWNER}/packages/container/${PACKAGE_ENC}/versions/${VERSION_ID}" - echo "Deleted staged image version ${VERSION_ID} (${STAGING_TAG})" - else - echo "No staged image found for ${STAGING_TAG}, skipping" - fi - done From d87cad56df523dfd668781cfcc748a26ea9fc9a2 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Fri, 21 Aug 2026 08:30:23 +0200 Subject: [PATCH 2/2] gha: add missing comment for the branch tag conversion Signed-off-by: Alice Frosi --- .github/workflows/integration-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 322090e..aaae358 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -68,6 +68,9 @@ jobs: ALL=$(curl -s https://endoflife.date/api/kubernetes.json | \ jq -c '[.[] | select(.eol > (now | strftime("%Y-%m-%d"))) | .cycle][:3]') NON_DEFAULT=$(echo "$ALL" | jq -c --arg default "$DEFAULT" 'map(select(. != $default))') + # Construct the staging branch tag based on the branch name that is suitable for container image + # tags. It converts all the character to lower cases, and replaces all non lower cases letter, numbers, '.' + # or '-' with a single hyphen. BRANCH_TAG=$(echo "${{ github.head_ref || github.ref_name }}" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9._-]+/-/g') echo "all-versions=${ALL}" >> "$GITHUB_OUTPUT" echo "non-default-versions=${NON_DEFAULT}" >> "$GITHUB_OUTPUT" @@ -439,4 +442,3 @@ jobs: sudo podman tag ${DISK_SRC} ${PUSH_DEST}:latest-disk-composefs sudo podman push ${PUSH_DEST}:latest-disk-composefs fi -