File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 33This is a GitHub Action to delete GitHub packages. It is very useful to clean up unneeded Docker
44images in the GitHub Container Registry (ghcr.io) after a PR is closed.
55
6+ The example below removes Docker images in ghcr.io with the specified package name and tag. Here, ` github-token `
7+ is set to a secret, ` CI_ACTION_TOKEN ` , which is a personal access token with package deletion permissions.
8+
69```
710# Delete Docker images after PR merge
811#
1821 name: Delete image from ghcr.io
1922 runs-on: ubuntu-latest
2023 steps:
21- - uses: chipkent/action-cleanup-package@v1.0.0
24+ - uses: chipkent/action-cleanup-package@v1.0.1
2225 with:
2326 package-name: ${{ github.event.repository.name }}
2427 tag: pr-${{ github.event.pull_request.number }}
Original file line number Diff line number Diff line change 1919 python-version : ' 3.8'
2020 - name : Install packages
2121 run : pip install requests
22+ shell : bash
2223 - name : Delete image from ghcr.io
2324 run : python ${{ github.action_path }}/docker-cleanup.py ${{ inputs.package-name }} ${{ inputs.tag }} ${{ inputs.github-token }}
25+ shell : bash
You can’t perform that action at this time.
0 commit comments