Skip to content

tradeparadigm/ghcr-delete-image-action

 
 

Repository files navigation

ghcr-delete-image

CI wakatime

Delete image from Github Container Registry by tag. Useful for cleanup of pull request scoped images.

Usage

Example of workflow, that delete image when PR was closed.

name: '[RM] Preview'

on:
  pull_request:
    types: [closed]

jobs:
  purge-image:
    name: Delete image from ghcr.io
    runs-on: ubuntu-latest
    steps:
      - name: Delete image
        uses: tradeparadigm/[email protected]
        with:
          # NOTE: at now only orgs is supported
          owner: tradeparadigm
          name: some-web-service
          # NOTE: using Personal Access Token
          token: ${{ secrets.PAT }}
          tag: pr-${{github.event.pull_request.number}}

About

♻️ Delete GitHub Container Registry image by tag

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%