-
Notifications
You must be signed in to change notification settings - Fork 3
31 lines (26 loc) · 1.02 KB
/
trigger-release.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
name: Trigger Release if more than 30 days no releases
on:
schedule:
# Every Monday at 04:00
- cron: '0 4 * * 1'
jobs:
trigger-check:
name: Check is a new Release needed
runs-on: ubuntu-latest
steps:
- name: Gets latest created release info
id: latest_release_info
uses: jossef/action-latest-release-info@40167002208bfed9f789cccc7d3222fda2d82dd6 # v1.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: calculation
run: |
RELEASE_TIME="$(date +%s -u -d ${{ steps.latest_release_info.outputs.created_at }})"
TIME_NOW="$(date +%s -u)"
DAYS_AFTER_RELEASE="$(date +%-j -d @$(( $TIME_NOW - $RELEASE_TIME )))"
echo "days_after_release=$DAYS_AFTER_RELEASE" >> $GITHUB_OUTPUT
- name: Repository Dispatch
if: ${{ steps.calculation.outputs.days_after_release > 30 }}
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
with:
event-type: trigger-release