Skip to content

Cleanup

Cleanup #148

Workflow file for this run

name: Cleanup
on:
workflow_dispatch:
inputs:
dry-run:
description: Run the registry cleanup script without making any changes.
required: false
default: false
type: boolean
schedule:
- cron: "20 23 */2 * *"
delete:
branches-ignore:
- "main"
- "dependabot/**"
tags-ignore:
- "dependabot/**"
pull_request:
types:
- closed
jobs:
registry:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
name: Registry Cleanup
runs-on: ubuntu-latest
steps:
- name: Delete all containers from repository without tags
uses: quartx-analytics/ghcr-cleaner@v1
with:
dry-run: ${{ inputs.dry-run || 'false' }}
token: ${{ secrets.REGISTRY_TOKEN }}
package-name: calllogger
owner-type: org
delete-untagged: true
keep-at-most: 5
filter-tags: v*
skip-tags: latest
branch_deleted:
if: github.event_name == 'delete' && github.event.ref_type == 'branch'
name: Branch Deletion
runs-on: ubuntu-latest
steps:
- name: Delete Branch Container Image
uses: bots-house/ghcr-delete-image-action@v1.1.0
continue-on-error: true
with:
name: calllogger
owner: ${{ github.repository_owner }}
token: ${{ secrets.REGISTRY_TOKEN }}
tag: ${{ github.event.ref }}
pr-closed:
if: github.event_name == 'pull_request'
name: PR Closed
runs-on: ubuntu-latest
steps:
- name: Delete Pull Request Image
uses: bots-house/ghcr-delete-image-action@v1.1.0
continue-on-error: true
with:
name: calllogger
owner: ${{ github.repository_owner }}
token: ${{ secrets.REGISTRY_TOKEN }}
tag: pr-${{github.event.pull_request.number}}