-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (32 loc) · 990 Bytes
/
delete-old-container.yml
File metadata and controls
37 lines (32 loc) · 990 Bytes
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
name: Delete old container images
on:
schedule:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Testing the container deletion mechanism'
jobs:
purge-image:
name: Delete image from ghcr.io
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
- name: Delete image release candiate
uses: r26d/ghcr-delete-image-action@v1.1.0
with:
owner: ${{ github.repository_owner }}
name: ${{ env.REPOSITORY_NAME }}
token: ${{ secrets.GH_DELETE_PACKAGE }}
tagged-keep-latest: 5
untagged-keep-latest: 5
tag-regex: \d\.\d.\d-rc\d