GHCR Purge success even if package doesn't exist #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Purge PR images | |
on: | |
pull_request_target: | |
types: | |
- closed | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
purge-pr-package: | |
name: Delete images from ghcr.io when PR is closed | |
runs-on: ubuntu-latest | |
steps: | |
- uses: chipkent/[email protected] | |
id: cleanup | |
continue-on-error: true | |
with: | |
package-name: ${{ github.event.repository.name }} | |
tag: pr-${{ github.event.pull_request.number }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/delete-package-versions@v4 | |
if: job.steps.cleanup.status == success() | |
name: Delete untagged images from ghcr.io | |
continue-on-error: true | |
with: | |
package-name: "teslamate" | |
package-type: "container" | |
min-versions-to-keep: 0 | |
delete-only-untagged-versions: "true" | |
token: ${{ secrets.GITHUB_TOKEN }} |