fix: remove untagged manifest cleanup, deletes tagged chart by shared digest
All checks were successful
Build & Release / build (push) Successful in 26s
All checks were successful
Build & Release / build (push) Successful in 26s
This commit is contained in:
@@ -60,23 +60,6 @@ jobs:
|
||||
helm registry login registry.digitalocean.com -u token --password "${{ secrets.DOCR_TOKEN }}"
|
||||
helm package chart/
|
||||
helm push lunarfront-$VERSION.tgz oci://registry.digitalocean.com/lunarfront
|
||||
# Remove untagged manifests left by helm push (OCI index artifacts)
|
||||
curl -s "https://api.digitalocean.com/v2/registry/lunarfront/repositories/lunarfront/tags?per_page=100" \
|
||||
-H "Authorization: Bearer ${{ secrets.DOCR_TOKEN }}" | \
|
||||
python3 -c "
|
||||
import sys, json, urllib.request
|
||||
data = json.load(sys.stdin)
|
||||
token = '${{ secrets.DOCR_TOKEN }}'
|
||||
for tag in data.get('tags', []):
|
||||
if not tag['tag']:
|
||||
digest = tag['manifest_digest']
|
||||
req = urllib.request.Request(
|
||||
f'https://api.digitalocean.com/v2/registry/lunarfront/repositories/lunarfront/digests/{digest}',
|
||||
method='DELETE', headers={'Authorization': f'Bearer {token}'}
|
||||
)
|
||||
try: urllib.request.urlopen(req)
|
||||
except: pass
|
||||
"
|
||||
|
||||
- name: Logout
|
||||
if: always()
|
||||
|
||||
Reference in New Issue
Block a user