-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (37 loc) · 1.14 KB
/
commit-random.yml
File metadata and controls
42 lines (37 loc) · 1.14 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
37
38
39
40
41
42
name: keep github-green
on:
schedule:
# 分散在全天的多个时间点(UTC),模拟全球用户活动
# UTC 01:00, 05:00, 09:00, 13:00, 17:00, 21:00
# 对应北京时间 09:00, 13:00, 17:00, 21:00, 01:00, 05:00
- cron: '0 1,5,9,13,17,21 * * *'
workflow_dispatch: {}
permissions:
contents: write
jobs:
randomized-commits:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run randomized commit script
env:
REPO: ${{ github.repository }}
GITHUB_ACTOR: ${{ github.actor }}
ACTOR_NAME: ${{ secrets.ACTOR_NAME }}
ACTOR_EMAIL: ${{ secrets.ACTOR_EMAIL }}
PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }}
SKIP_PROB: "0.09"
MAX_COMMITS: "4"
MIN_SLEEP: "15"
MAX_SLEEP: "90"
MAX_START_DELAY_MINUTES: "60"
run: |
chmod +x .github/scripts/random_commit.py
python3 .github/scripts/random_commit.py