diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 024dcff..3547422 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,6 +74,7 @@ jobs: docker: name: Docker runs-on: ubuntu-latest + # if: needs.semantic-release.outputs.new_release_version != '' permissions: contents: read attestations: write @@ -148,6 +149,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64 cache-from: type=gha cache-to: type=gha,mode=max secrets: | @@ -231,13 +233,22 @@ jobs: PACKAGE_NAME: "wakatime-leaderboards" run: | echo "Fetching GHCR tags..." - tags=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ - "https://api.github.com/user/packages/container/$PACKAGE_NAME/versions" | jq -r '.[].metadata.container.tags[]') + page=1 + all_tags="" + while true; do + tags=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ + "https://api.github.com/user/packages/container/$PACKAGE_NAME/versions?per_page=100&page=$page" | jq -r '.[].metadata.container.tags[]') + if [ -z "$tags" ]; then + break + fi + all_tags="$all_tags $tags" + ((page++)) + done echo "Tags found in GHCR:" - echo "$tags" - latest_tag=$(echo "$tags" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -rV | head -n 1) + echo "$all_tags" + latest_tag=$(echo "$all_tags" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -rV | head -n 1) echo "Latest semantic version tag is $latest_tag" - for tag in $tags; do + for tag in $all_tags; do if [[ "$tag" != "master" && "$tag" != "$latest_tag" ]]; then echo "Deleting tag $tag from GHCR" version_id=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ diff --git a/action.yml b/action.yml index 9ee1609..bdfa6e0 100644 --- a/action.yml +++ b/action.yml @@ -11,7 +11,7 @@ inputs: required: true runs: using: docker - image: "docker://nicconike/wakatime-leaderboards:latest" + image: "docker://nicconike/wakatime-leaderboards:master" branding: icon: activity color: blue