Skip to content

Optimize your Amazon ECR repository management with the Delete Old ECR Images GitHub Action. Take charge of your container image lifecycle effortlessly: tidy up outdated images, tailor retention policies, and test with dry runs for seamless DevOps workflows.

License

Notifications You must be signed in to change notification settings

agungwa/ECR-Lifecycle-Manager

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Delete Old ECR Images GitHub Action

This GitHub Action helps you manage your Amazon ECR (Elastic Container Registry) repositories by deleting old images, optionally limiting deletion to untagged images. It allows you to specify parameters such as the repository name, the number of latest images to keep, whether to perform a dry run, and whether to delete only untagged images.

Usage

yaml

- name: Delete old ECR images
  uses: agungwa/ECR-Lifecycle-Manager@v1.1.1
  with:
    repo_name: <your-repository-name>
    num_to_keep: 10
    dry_run: true
    delete_untagged_images: false

Inputs

  • repo_name: (required) The name of the ECR repository to delete images from.
  • num_to_keep: (optional) The number of latest images to keep. Default is 10.
  • dry_run: (optional) Perform a dry run without actually deleting images. Default is true.
  • delete_untagged_images: (optional) Delete only untagged images. Default is false.

Example

yaml

- name: Delete old ECR images
  uses: agungwa/ECR-Lifecycle-Managers@v1.1.1
  with:
    repo_name: my-ecr-repo
    num_to_keep: 5
    dry_run: false
    delete_untagged_images: true

License

This project is licensed under the MIT License.

Feedback

If you encounter any issues or have suggestions for improvements, please don't hesitate to open an issue or pull request in the GitHub repository.

About

Optimize your Amazon ECR repository management with the Delete Old ECR Images GitHub Action. Take charge of your container image lifecycle effortlessly: tidy up outdated images, tailor retention policies, and test with dry runs for seamless DevOps workflows.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published