github_greener_bot
Automation in the wrong way!!!
This is a experiment project that helps me contribute rubbish and keeps my GitHub account "Active", so that employers can be satisfied by my "Active" GitHub account.
I'M JOKING. PLEASE DON'T DO THIS. LOL
Technology
- AWS Lambda
- Node.js
How to use
-
Fork/ Create a repo
-
Create a AWS Lambda function, choose Node.js 8.10 for its runtime. (Due to the change of OS, at the time of writing Git doesn't work on Node.js 10.x runtime)
-
Add a Layer for Git.
Choose the option
Provide a layer version ARN
and enter the followingarn:aws:lambda:us-east-1:553035198032:layer:git:6
. It is a layer that allows your functions to usegit
andssh
binaries. I found it here: git-lambda-layer -
Copy the script
index.js
. You can use its inline code editor. -
Generate access token in GitHub Developer Settings
-
Configure environment variables on Lambda. Four env variables are needed:
GH_Email
- Your email addressGH_USERNAME
- Your usernameGH_REPO
- Your repository nameGH_TOKEN
- Your Github token -
Change the commit message to your like (but I think it doesn't matter :P)
-
Test the function.
- In basic settings, I set my timeout to 5 sec which I found enough.
-
Add a CloudWatch Event trigger using Rate/ Cron to specify the time for auto updating GitHub repo.
How to write Rate/ Cron expression: Schedule Expressions Using Rate or Cron
To do
- Function script
- Trigger
- Stop if the user is active on that day
- Generate random number of commits
- Issues
- Pull requests
- Code review