Skip to content

Commit

Permalink
Create self.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Likhon Sheikh authored Aug 14, 2024
1 parent 6867d77 commit 288d7e4
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/self.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Daily Commit

on:
schedule:
- cron: '*/5 * * * *' # Runs every 5 minutes
workflow_dispatch:

jobs:
commit:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Make changes
run: |
echo "Commit made at $(date '+%Y-%m-%d %H:%M:%S')" > log.txt
- name: Pull latest changes
run: git pull

- name: Commit and Push for Multiple Users
run: |
# List of users
users=(
"[email protected]:rNLKJA"
"[email protected]:Martin Nilsson"
"[email protected]:Heekang Park"
"[email protected]:Chen Zhiwei"
"[email protected]:Ben Cunningham"
"[email protected]:hdknr"
"[email protected]:Sanghyuk Jung"
"[email protected]:Gijs Joost Brouwer"
"[email protected]:Mercedes-benz"
"[email protected]:Lamborghini"
"[email protected]:anushka"
"[email protected]:Han Solo"
"[email protected]:Patrick Raco"
)
for user in "${users[@]}"; do
email="${user%%:*}"
name="${user##*:}"
# Set Git user details globally
git config --global user.email "$email"
git config --global user.name "$name"
# Make the changes for the user
echo "Commit by $name at $(date '+%Y-%m-%d %H:%M:%S')" > "log_${name// /_}.txt"
# Stage and commit the changes
git add "log_${name// /_}.txt"
git commit -m "Daily update by $name at $(date '+%Y-%m-%d %H:%M:%S')"
done
- name: Push Changes
run: git push

0 comments on commit 288d7e4

Please sign in to comment.