Skip to content

Commit 8e2d7e2

Browse files
authored
Create autocommit.yml
1 parent b229dde commit 8e2d7e2

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Auto Commit
2+
on:
3+
schedule:
4+
- cron: "0 * * * *" # Menjalankan setiap jam
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
auto-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Pull latest changes
16+
run: git pull origin main --rebase || echo "No changes to pull"
17+
18+
- name: Update LAST_UPDATED file
19+
run: |
20+
echo "=== Modifying LAST_UPDATED File ==="
21+
echo "Last updated at: $(date -u)" > LAST_UPDATED
22+
cat LAST_UPDATED
23+
24+
- name: Configure Git
25+
run: |
26+
git config --global user.name "AutoFTbot"
27+
git config --global user.email "[email protected]"
28+
29+
- name: Commit changes
30+
run: |
31+
git add .
32+
arr=("chore(bot): πŸ˜‚ auto commit"
33+
"chore(bot): 😱 auto commit"
34+
"chore(bot): πŸ‘Ώ auto commit"
35+
"chore(bot): πŸ’© auto commit"
36+
"chore(bot): πŸ™ auto commit"
37+
"chore(bot): πŸ™ˆ auto commit"
38+
"chore(bot): 🐐 auto commit"
39+
"chore(bot): πŸ€– auto commit"
40+
"chore(bot): 🟩 auto commit"
41+
"chore(bot): πŸ‘» auto commit")
42+
random_message=${arr[$RANDOM % ${#arr[@]}]}
43+
git commit -m "$random_message" || echo "No changes to commit"
44+
45+
- name: Push changes
46+
run: git push origin main
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Debug logs
51+
run: |
52+
git status
53+
git log -n 3

0 commit comments

Comments
Β (0)