-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't remove untagged images on develop
- Loading branch information
Showing
1 changed file
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
# } | ||
# } |