Skip to content

Scheduled Commit Bot #48

Scheduled Commit Bot

Scheduled Commit Bot #48

Workflow file for this run

name: Scheduled Commit Bot
on:
schedule:
- cron: '0 0 * * *'
jobs:
commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Git
run: |
git config --global user.name 'rahfianugerah'
git config --global user.email 'nrahfia@gmail.com'
- name: Random number generation
id: random
# Generates a random number between 1 to 2
run: echo "::set-output name=random_number::$(shuf -i 1-2 -n 1)"
- name: Make commits
run: |
for ((i=0; i<${{ steps.random.outputs.random_number }}; i++)); do
echo "$(date)" >> commit.txt
git add commit.txt
git commit -m "Automated Commit at $(date)"
done
git push