The task.sh
script generates random commit messages and updates an update.md
file in your repository with the last update timestamp. It's a fun way to automate your daily commits while keeping your GitHub contribution graph green.
-
The script defines an array of commit messages, each with an emoji and a short description.
-
It generates a random number to select a message from the array.
-
It gets the current date and time.
-
If the
update.md
file doesn't exist, it creates it and stages it for commit. -
It appends the last update timestamp to the
update.md
file. -
It configures local Git user information (you can replace the email and username with your own).
-
Finally, it commits the changes to the repository with a random commit message and the current timestamp.
By default, GITHUB_TOKEN
only has Read repository contents and packages permissions
(the restricted setting).
- Under your repository name, click Settings.
- In the left sidebar, click Actions, then click General.
- Under "Workflow permissions", enable
Read and write permissions
(the permissive setting). - Click Save to apply the settings.
- Replace the Git user information with your own.
- Change the cron schedule for the automation of daily commits. (Refer: https://crontab.guru/)
- Modify the messages array to include your own commit messages.
- GitHub Actions runs on Coordinated Universal Time (UTC) time, so commit timestamps will be in UTC, affecting your GitHub contribution graph based on UTC time instead of your local time zone.