-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
36 lines (32 loc) · 1.09 KB
/
keep-alive.yml
File metadata and controls
36 lines (32 loc) · 1.09 KB
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
name: Keep Alive
on:
workflow_dispatch:
schedule:
# Run every 30 days at 00:00 UTC to keep the repository active
- cron: '0 0 */30 * *'
jobs:
keep-alive:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update keep-alive file
run: |
mkdir -p .github
echo "Last run: $(date -u +'%Y-%m-%d %H:%M:%S UTC')" > .github/keep-alive.txt
echo "This file is automatically updated to keep the repository active and prevent GitHub Actions from disabling scheduled workflows." >> .github/keep-alive.txt
- name: Commit and push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .github/keep-alive.txt
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update keep-alive timestamp [skip ci]"
git push
fi