Auto Commit #2406
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto Commit | |
| on: | |
| schedule: | |
| - cron: "0 * * * *" # Menjalankan setiap jam | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| auto-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Pull latest changes | |
| run: git pull origin main --rebase || echo "No changes to pull" | |
| - name: Update LAST_UPDATED file | |
| run: | | |
| echo "=== Modifying LAST_UPDATED File ===" | |
| echo "Last updated at: $(date -u)" > LAST_UPDATED | |
| cat LAST_UPDATED | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "AutoFTbot" | |
| git config --global user.email "[email protected]" | |
| - name: Commit changes | |
| run: | | |
| git add . | |
| arr=("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") | |
| random_message=${arr[$RANDOM % ${#arr[@]}]} | |
| git commit -m "$random_message" || echo "No changes to commit" | |
| - name: Push changes | |
| run: git push origin main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Debug logs | |
| run: | | |
| git status | |
| git log -n 3 |