Skip to content

Auto Commit

Auto Commit #2483

Workflow file for this run

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 }}