-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.63 KB
/
autocommit.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Auto Commit
on:
push:
branches:
- main
schedule:
- cron: "0 4,12,15,18,19,23 * * *" # Runs at 4 AM, 12 PM, 3 PM, 6 PM, 7 PM, 11 PM, and midnight UTC
jobs:
auto_commit:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Update Last Modified Timestamp
run: |
current_date=$(date '+%Y-%m-%dT%H:%M:%SZ')
echo $current_date > LAST_UPDATED
- name: Configure Git
run: |
git config --local user.name "XIN"
git config --local user.email "[email protected]"
- name: Commit Changes
run: |
git add -A
# Define commit messages
commit_messages=(
"chore(bot): 🔥 auto commit"
"chore(bot): 💀 auto commit"
"chore(bot): 👹 auto commit"
"chore(bot): 👺 auto commit"
"chore(bot): 🤡 auto commit"
"chore(bot): 👻 auto commit"
"chore(bot): 👽 auto commit"
"chore(bot): 🤖 auto commit"
"chore(bot): 👾 auto commit"
"chore(bot): 😈 auto commit"
)
# Select a random commit message
random_index=$(( RANDOM % ${#commit_messages[@]} ))
git commit -m "${commit_messages[$random_index]}"
- name: Push Changes
uses: ad-m/github-push-action@master
with:
force: true
directory: "."
github_token: ${{ secrets.GITHUB_TOKEN }}