From b1d491226bbb2ca1e6a1a396170eef25e463db17 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 18 Feb 2025 16:38:51 +0100 Subject: [PATCH] chore: delete old docker hassio nightly tags, only keep last 2 (#18852) --- .github/workflows/nightly.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5dd3b7508..198224978 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -59,7 +59,7 @@ jobs: - name: Setup Buildx uses: docker/setup-buildx-action@v3 - - name: Docker meta + - name: Define tags id: meta uses: docker/metadata-action@v5 with: @@ -76,6 +76,14 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} + - name: Delete old nightly.* tags + run: | + old_tags=$(curl -s "https://hub.docker.com/v2/repositories/evcc/evcc/tags/?page_size=100" | jq -r '.results | map(select(.name | startswith("nightly."))) | sort_by(.last_updated) | reverse | .[1:] | .[].name') + for tag in $old_tags; do + echo "Deleting tag: $tag" + curl -s -H "Authorization: Bearer ${{ secrets.DOCKER_TOKEN }}" -X DELETE "https://hub.docker.com/v2/repositories/evcc/evcc/tags/$tag/" + done + hassio: name: Hassio Addon :nightly needs: