-
Notifications
You must be signed in to change notification settings - Fork 41
45 lines (40 loc) · 1.25 KB
/
image-cleanup.yaml
File metadata and controls
45 lines (40 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
name: Container Image Cleanup
on:
workflow_dispatch:
inputs:
image-tags:
required: false
type: string
description: Which images to remove. Supports GLOB pattern.
default: "!latest !v*.*.*"
dry-run:
required: false
type: boolean
description: Prints output showing images which would be deleted but does not actually delete any images.
default: true
env:
repo: agntcy
images: oasf-server
permissions:
packages: write
jobs:
dispatch:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
name: Cleanup stale container images
steps:
- name: Remove stale images
uses: snok/container-retention-policy@4f22ef80902ad409ed55a99dc5133cc1250a0d03 # v3.0.0
with:
# Who should delete images
account: ${{ env.repo }}
token: ${{ secrets.GITHUB_TOKEN }}
# How to delete images
dry-run: ${{ inputs.dry-run }}
cut-off: 1s
timestamp-to-use: created_at
# Which images should be deleted
image-names: ${{ env.images }}
image-tags: ${{ env.image-tags }}