This action will clean up the oldest Docker packages hosted on GitHub. This is intended to be run in the GitHub repo where the package exists. This action differs from others in that it aims to try an keep the most recent 100 (or less) packages, as opposed to removing specific versions.
Please read information on the GraphQL query we use to accomplish this here. This mutation is in "preview" as per GitHub docs.
Required a token which has the ability to remove packages in the repo.
Required the name of the docker-package you'd like to remove versions of.
Optional the number of most recent images to keep. Default: 100
Optional removing packages can be scary so this will show you what we would remove (true/false).
a list of packages that were cleaned/removed from the repository
uses: cirrusmd/[email protected]
with:
gh-token: ${{ secrets.YOUR_GH_TOKEN_SECRET }}
docker-package: 'dockerImage'
dry-run: true # enable dry-run just to test it
- Make any necessary changes to the src/ and test/ directories.
- ensure that ncc is installed
npm i -g @vercel/ncc
- package
ncc build src/repoclean.js --license LICENSE
- ensure that dist/ is up-to-date