Repository navigation
63 lines (49 loc) · 1.82 KB
/
Copy pathauto-commit.yml
File metadata and controls
63 lines (49 loc) · 1.82 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Daily Auto Commit
on:
schedule:
- cron: '0 1 * * *' # Setiap hari jam 1 pagi UTC (8 pagi WIB)
workflow_dispatch: # Bisa trigger manual juga
jobs:
auto-commit:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure Git
run: |
git config --global user.name "salsabila2507"
git config --global user.email "salsabila2507@users.noreply.github.com"
- name: Create daily activity
run: |
DATE=$(date '+%Y-%m-%d %H:%M:%S')
DAY=$(date '+%j')
YEAR=$(date '+%Y')
QUOTES=(
"Consistency is key to success 🚀"
"Small daily improvements lead to stunning results 💪"
"Keep pushing forward, one commit at a time 🔥"
"Building great things takes time and dedication ⚡"
"Every day is a chance to improve 🌟"
"Progress over perfection 📈"
"Stay committed to your goals 🎯"
"Code today, conquer tomorrow 💻"
)
RANDOM_QUOTE=${QUOTES[$RANDOM % ${#QUOTES[@]}]}
cat > ACTIVITY.md << EOF
# Daily Activity Log
## 📅 Date: $DATE
**Day #$DAY of $YEAR**
### 🎯 Today's Progress
$RANDOM_QUOTE
### 📊 Streak Status
- ✅ Commit maintained
- 🔥 Keeping the streak alive!
---
*Auto-generated by GitHub Actions*
EOF
- name: Commit and Push
run: |
git add ACTIVITY.md
git diff --quiet && git diff --staged --quiet || (git commit -m "📝 Daily update - $(date '+%Y-%m-%d')" && git push)