Skip to content

Commit

Permalink
Don't remove untagged images on develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Oct 19, 2023
1 parent b0cb816 commit 1b7ea1e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/actions/docker-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ runs:
docker tag $IMAGE_ID:${{ inputs.version }} $IMAGE_ID:latest --platform=linux/amd64 .
docker push $IMAGE_ID:latest
shell: bash
- name: Delete untagged images
uses: actions/[email protected]
with:
github-token: ${{ inputs.github-token }}
script: |
const response = await github.request("GET /orgs/${{ github.repository_owner }}/packages/container/$IMAGE_ID/versions",
{ per_page: 100
});
for(version of response.data) {
if (version.metadata.container.tags.length == 0 && version.name !== "latest" && version.name !== "preview") {
console.log("Delete " + version.id)
# - name: Delete untagged images
# uses: actions/[email protected]
# with:
# github-token: ${{ inputs.github-token }}
# script: |
# const response = await github.request("GET /orgs/${{ github.repository_owner }}/packages/container/${{ IMAGE_ID }}/versions",
# { per_page: 100
# });
# for(version of response.data) {
# if (version.metadata.container.tags.length == 0 && version.name !== "latest" && version.name !== "preview") {
# console.log("Delete " + version.id)

const deleteResponse = await github.request("DELETE /orgs/${{ github.repository_owner }}/packages/container/$IMAGE_ID/versions/" + version.id, { });
console.log("status " + deleteResponse.status)
}
}
# const deleteResponse = await github.request("DELETE /orgs/${{ github.repository_owner }}/packages/container/${{ IMAGE_ID }}/versions/" + version.id, { });
# console.log("status " + deleteResponse.status)
# }
# }

0 comments on commit 1b7ea1e

Please sign in to comment.