-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Likhon Sheikh
authored
Aug 14, 2024
1 parent
6867d77
commit 288d7e4
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |