forked from ophub/amlogic-s9xxx-armbian
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.34 KB
/
delete-older-releases-artifacts.yml
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
46
47
#==========================================================================
# https://github.com/ophub/amlogic-s9xxx-armbian
# Description: Automatically delete older releases and artifacts
#==========================================================================
name: Delete older releases and artifacts
on:
repository_dispatch:
workflow_dispatch:
#schedule:
#- cron: "0 23 * * 0"
env:
DELETE_RELEASE: true
DELETE_ARTIFACTS: true
KEEP_DAY: 1
KEEP_MININUM_RUNS: 0
KEEP_MININUM_RELEASE: 4
jobs:
build:
runs-on: ubuntu-22.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Checkout
uses: actions/checkout@main
- name: Delete older releases
uses: dev-drprasad/delete-older-releases@master
if: env.DELETE_RELEASE == 'true'
with:
keep_latest: ${{ env.KEEP_MININUM_RELEASE }}
delete_tags: true
delete_tag_pattern: _
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Delete older workflow runs and artifacts
uses: Mattraks/delete-workflow-runs@main
if: env.DELETE_ARTIFACTS == 'true'
with:
token: ${{ secrets.GH_TOKEN }}
repository: ${{ github.repository }}
retain_days: ${{ env.KEEP_DAY }}
keep_minimum_runs: ${{ env.KEEP_MININUM_RUNS }}