-
Notifications
You must be signed in to change notification settings - Fork 567
42 lines (36 loc) · 1.13 KB
/
autodelete.yaml
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
name: Auto-delete expired domains
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Warn domains expiring in 1 month
run: |
export DATE=$(date -d "$(date -d "1 month") 1 year ago")
export EXPIRY="will expire in 1 month"
./scripts/expiring.sh
- name: Warn domains expiring in 1 week
run: |
export DATE=$(date -d "$(date -d "1 week") 1 year ago")
export EXPIRY="will expire next week"
./scripts/expiring.sh
- name: Warn domains expiring in 1 day
run: |
export DATE=$(date -d "$(date -d "1 day") 1 year ago")
export EXPIRY="expires tomorrow"
./scripts/expiring.sh
- name: Delete domains older than 1 year
run: |
export DATE=$(date -d "1 year ago")
./scripts/expired.sh
- name: Commit any changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Delete expired domains