Skip to content

Auto commit

Auto commit #943

Workflow file for this run

name: Auto commit
on:
push:
branches:
- master
schedule:
- cron: "0 3,12 * * *" # See https://crontab.guru/#0_7,9,11_*_*_1,3
jobs:
auto_commit:
runs-on: ubuntu-latest
steps:
- name: DEBUG
run: echo "::debug::Ref = ${{github.ref}}"
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Commit changes
run: |
rand=$(($RANDOM % 5))
amountCommit=$(($rand+1))
echo $amountCommit
for ((i=1; i<=$amountCommit; i++)); do
sleep 5 &
d=`date '+%Y-%m-%dT%H:%M:%SZ'`
wait
echo $d > LAST_UPDATED
wait
git config --local user.email "mohridwan1707@gmail.com"
wait
git config --local user.name "ridhlab"
wait
git add -A
wait
echo "Iteration $i"
wait
git commit -m "bot: auto commit at $d"
wait
done
- name: GitHub Push
uses: ad-m/github-push-action@master
with:
force: true
directory: "."
github_token: ${{ secrets.GITHUB_TOKEN }}