Skip to content
git-pull-request

GitHub Action

Stale Image Remover

v1.0.1 Latest version

Stale Image Remover

git-pull-request

Stale Image Remover

Remove stale images from your repo

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Stale Image Remover

uses: stevemar/image-deleter@v1.0.1

Learn more about this action in stevemar/image-deleter

Choose a version

image-deleter

There's only one script in the repo, it deletes image (PNG, JPG, JPEG) files that are not currently being used in a git repository.

Running the script

For convenience, there is an image on Docker Hub, run this command from your git project root:

docker run -v `pwd`:/source stevemar/image-deleter:latest

Or feel free to copy the file and run it locally:

./rm-images.sh

The output

The script will run git rm on the unused images. It's up to you to run git commit and git push.

Tips

If you want to re-build this with debug logs, just add this line to the Dockerfile:

ENV DEBUG=true

Re-build it locally and run it.