Welcome to Auto Commit and Chill, the coolest way to automate your GitHub commits like a boss! 🚀
This project automatically commits and pushes changes to your GitHub repository, so you can focus on the fun stuff and leave the repetitive tasks to the robots. 🤖💻
- Automatic commits every 2 hours (because, why not?) ⏰
- Pushes changes directly to your repo. No more "manual" pushing. It's like magic, but real. ✨
- Works seamlessly on GitHub Actions (and locally too, if you prefer to live dangerously). 🏠
- Create or update a file (I'm using
anil-magic.txt
for example – because it’s magic). - Commit and push those changes to your GitHub repo. 🏆
- All automated. No humans involved (except when setting it up, obviously). 😎
Clone the project repository using SSH:
git clone [email protected]:anilrajrimal1/auto-commit-and-chill.git
- Create a new repository on your GitHub account.
- Set the newly created repository as the upstream:
git remote add upstream <your-repo-url>
Modify the following variables in the script:
if 'GITHUB_ACTIONS' in os.environ:
local_dir = '/home/runner/work/auto-commit-and-chill/auto-commit-and-chill'
else:
local_dir = '/home/anil/Desktop/learning/learn-scripting/auto-commit-and-chill'
repo_name = '<your-username>/<your-repo>'
file_name = 'anil-magic.txt'
commit_message = 'Update example file using Python script'
branch_name = 'master'
repo.git.config('user.name', '<your-username>') # Name
repo.git.config('user.email', '<your-email>') # Email
- Generate a GitHub Access Token with
repo
andworkflow
permissions. - Add the token to your
.env
file and as a GitHub secret in your repository with the titleACCESS_TOKEN
- Generate or use an existing SSH key pair associated with your GitHub account.
- If you already had the pair, add the public key to your GitHub account and associated private key as a GitHub secret with the title
ACTIONS_SSH_KEY
.
Uncomment the following trigger in the workflow configuration file (.github/workflows/main.yml
):
on:
# schedule:
# - cron: '0 */2 * * *' # Every 2 hours
workflow_dispatch:
Push the codebase to the upstream repository forcefully:
git push -u upstream master --force
- The workflow runs automatically every 2 hours.
- You can also manually trigger it via the GitHub Actions UI.
- Procrastination level: Expert 🏆
- Productivity level: 1000% 📈
- Stress level: Zero 👌
Just sit back, relax, and let this little script handle the rest. 😎
This project is licensed under the MIT License, so feel free to use it, share it, or even improve it if you’re in the mood. 🎉