File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,15 +108,19 @@ jobs:
108108 cd dist
109109 sha256sum * > checksums.txt
110110
111- - name : Delete existing snapshot release and tag
111+ - name : Clean up old snapshot releases
112112 run : |
113- gh release delete snapshot --yes --cleanup-tag || true
113+ # Delete all previous snapshot-* releases (keep only latest)
114+ gh release list --limit 50 | grep '^snapshot-' | awk '{print $1}' | while read tag; do
115+ gh release delete "$tag" --yes --cleanup-tag || true
116+ done
114117 env :
115118 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
116119
117120 - name : Create snapshot release
118121 run : |
119- gh release create snapshot \
122+ TAG="snapshot-$(git rev-parse --short HEAD)"
123+ gh release create "$TAG" \
120124 --title "Snapshot (${{ steps.version.outputs.version }})" \
121125 --notes "Automated pre-release snapshot built from the latest commit on \`main\`.
122126
@@ -156,7 +160,7 @@ jobs:
156160
157161 - name : Build and push snapshot
158162 env :
159- KO_DOCKER_REPO : ghcr.io/${{ github.repository }}
163+ KO_DOCKER_REPO : ghcr.io/gocodealone/workflow
160164 GOPRIVATE : github.com/GoCodeAlone/*
161165 GONOSUMCHECK : github.com/GoCodeAlone/*
162166 GOFLAGS : -mod=mod
You can’t perform that action at this time.
0 commit comments