File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Keepalive
2+
3+ on :
4+ schedule :
5+ - cron : " 45 5 * * 1"
6+ workflow_dispatch :
7+
8+ permissions : { contents: write }
9+ concurrency : { group: keepalive, cancel-in-progress: false }
10+
11+ jobs :
12+ keepalive :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+ - name : Empty commit when the repo nears the scheduled-workflow disable window
17+ run : |
18+ days_old=$(( ( $(date -u +%s) - $(git log -1 --format=%ct) ) / 86400 ))
19+ echo "Last commit was $days_old day(s) ago"
20+ if [ "$days_old" -lt 45 ]; then
21+ echo "Fresh enough; nothing to do."
22+ exit 0
23+ fi
24+ git config user.name 'github-actions[bot]'
25+ git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
26+ git commit --allow-empty -m "chore(keepalive): keep scheduled workflows enabled [skip ci]"
27+ git push
You can’t perform that action at this time.
0 commit comments