File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Smart Daily Commits (UTC)
2+
3+ on :
4+ schedule :
5+ - cron : " 0 0 * * *" # Har kuni UTC 00:00
6+ workflow_dispatch :
7+
8+ jobs :
9+ smart-commits :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v4
15+
16+ - name : Decide commit count (even=5, odd=6)
17+ id : decide
18+ run : |
19+ DAY=$(date +%u) # 1=Mon … 7=Sun
20+
21+ if [ $((DAY % 2)) -eq 0 ]; then
22+ COUNT=5
23+ else
24+ COUNT=5
25+ fi
26+
27+ echo "count=$COUNT" >> $GITHUB_OUTPUT
28+
29+ - name : Make commits
30+ env :
31+ GH_PAT : ${{ secrets.GH_PAT }}
32+ run : |
33+ git config --global user.name "github-actions[bot]"
34+ git config --global user.email "[email protected] " 35+
36+ COUNT=${{ steps.decide.outputs.count }}
37+
38+ for i in $(seq 1 $COUNT); do
39+ echo "Update $i: $(date -u)" >> activity-log.txt
40+ git add activity-log.txt
41+ git commit -m "Auto commit $i (UTC $(date -u '+%H:%M:%S'))" || echo "No changes"
42+ done
43+
44+ git push https://[email protected] /baxtiff05-cell/auto-commit.git HEAD:main
You can’t perform that action at this time.
0 commit comments