Skip to content

Auto Commit

Auto Commit #74

Workflow file for this run

name: Auto Commit
on:
schedule:
# Runs every day at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allows manual trigger
jobs:
auto-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
persist-credentials: true
fetch-depth: 0
- name: Configure Git
run: |
git config --local user.email "wahyuivanmahendra@gmail.com"
git config --local user.name "Wahyu Ivan"
- name: Create commit
run: |
echo "Last updated: $(date)" >> activity.log
git add activity.log
git commit -m "Auto commit: $(date +'%Y-%m-%d %H:%M:%S')" || echo "No changes to commit"
- name: Push changes
run: |
git push origin main || git push origin master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}