{"id":17959137,"url":"https://github.com/stumpylog/image-cleaner-action","last_synced_at":"2025-03-25T03:31:07.792Z","repository":{"id":155816438,"uuid":"630734808","full_name":"stumpylog/image-cleaner-action","owner":"stumpylog","description":"Removes old containers from ghcr.io once their build source is gone","archived":false,"fork":false,"pushed_at":"2025-03-04T17:36:34.000Z","size":268,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T16:37:41.113Z","etag":null,"topics":["actions","docker","docker-image","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stumpylog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-21T03:12:54.000Z","updated_at":"2025-02-14T15:36:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"fee6ee03-f415-48aa-8ce8-13c6ba064c47","html_url":"https://github.com/stumpylog/image-cleaner-action","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Fimage-cleaner-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Fimage-cleaner-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Fimage-cleaner-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Fimage-cleaner-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stumpylog","download_url":"https://codeload.github.com/stumpylog/image-cleaner-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245394579,"owners_count":20608115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","docker","docker-image","hacktoberfest"],"created_at":"2024-10-29T11:01:34.003Z","updated_at":"2025-03-25T03:31:07.771Z","avatar_url":"https://github.com/stumpylog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Cleaner Action\n\nThis repository contains two actions for solving problems with the GitHub Container Registry.\n\n## Ephemeral Image Removal\n\nMany actions in a repository will end up creating a Docker image stored on the GitHub Container Registry\n(ghcr.io). This is quite useful, as another developer can pull the image to test your code or a\nuser can confirm the fix worked as expected. The image may be built on each push to a certain named branch or\nwhen a pull request is created or updated.\n\nBut what about after the fix has been made, the feature tested or the pull request merged? Do you really\nneed to keep the Docker image around, accessible and cluttering up your packages? That makes it harder for a\nuser to locate the last released tags. If you're paying for the storage space, each image takes up some\namount of storage as well.\n\nYou end up with a situation like this:\n\n![Repository with many stale images](./imgs/stale-images.png)\n\nThat's the problem this action attempts to solve. This action aims to simplify the cleaning of containers\nwhich are meant to be ephemeral. Once their job is completed, they don't need to exist in the registry.\n\nThis action correlates an image to its source, either a branch or a pull request. If the branch is\ndeleted or the pull request has closed, the image is un-versioned using the REST API.\n\nThis action plays nicely with the untagged cleaner, as un-versioning doesn't remove the actual image.\n\n### Features\n\n- Safe by default: only takes action after you directly tell it to\n- Verbose: Every action taken is logged, including with enough information to restore a deletion\n- Flexible: handles branch based or PR based naming\n\n### Usage\n\nFor details on using the action, see [the README for the action](./untagged/README.md)\n\n## Untagged Images Cleanup\n\nWhen a new image is built, tagged and pushed to replace an existing tag, the original\nimage doesn't get removed from the registry.\n\nYou end up with a situation like this:\n\n![Repository with many untagged images](./imgs/mang-tags.png)\n\nThese untagged images are still accessible using the `sha256:` digest of the image as a tag,\nbut most people are never using such tags. And the long lived tags, such as your releases\nwill always remain accessible via the `sha256:`\n\nIt's not directly a problem, but it is untidy. If you're paying for the storage space, each\nimage takes up some amount of storage as well. In an ideal world, there would be a retention\npolicy or reaper configuration to easily remove images based on some configuration. But as\nof now, GitHub doesn't provide such tools.\n\nThis action therefore handles deleting the untagged package versions using the REST API.\n\n### Features\n\n- Safe by default: only takes action after you directly tell it to\n- Verbose: Every action taken is logged, including with enough information to restore a deletion\n- Handles multi-architecture and regular images, even mixed in the same package\n- Handles packages owned by an organization or a user\n\n### Usage\n\nFor details on using the action, see [the README for the action](./ephemeral/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstumpylog%2Fimage-cleaner-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstumpylog%2Fimage-cleaner-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstumpylog%2Fimage-cleaner-action/lists"}