ci: updated workflow

This commit is contained in:
Marvin Zhang
2024-10-23 16:04:14 +08:00
parent 3b6d74ef9b
commit f7ae706644

View File

@@ -305,11 +305,11 @@ jobs:
id: list_versions
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/YOUR_ORG/packages/container/YOUR_PACKAGE_NAME/versions > versions.json
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/crawlab-team/packages/container/${{ matrix.image.name }}/versions > versions.json
jq --arg tag "${{ needs.setup.outputs.image_hash }}" '.[] | select(.metadata.container.tags[] | contains($tag)) | .id' versions.json > version_ids.txt
jq '.[] | select(.metadata.container.tags[] | contains("${{ needs.setup.outputs.image_hash }}")) | .id' versions.json > version_ids.txt
- name: Delete Docker image versions
uses: actions/delete-package-versions@v5
with: