A daily Github Actions program that helps users follow back their Github followers & star their top-4 repositories. This repository uses Github Actions to automate this process and Vercel to simplify cloning this repository for users to their Github account.
Table of Contents
-
Clone The Repository 👨🔬
-
Delete Data in your EXPLORED_LOGINS File 📄
-
Create Github Actions Workflow 👨💻
- Click
Add File > Create New Filein your Project Directory - Copy and Paste:
.github/workflows/actions.ymlas the Name of your File- The Contents from actions.yml into your File
- Click
Commit Changes
- Click
-
Grant Workflow Read/Write Permission ✍️
{Cloned_Repo_Name} > Settings > Actions > General- Scroll Down to
Workflow Permissions - Click
Read and Write Permissions - Click
Save
-
Create Personal Access Token 🥇
- Account > Settings > Developer Settings > Personal Access Tokens > Tokens (Classic)
- Click
Generate New Token > Generate New Token (Classic) - Name Your Token (example:
GITHUB_API_FOLLOW_N_STAR) - Choose an Expiration Date
- Select Scopes:
public_reporead:useruser:follow
- Click
Generate Token
Warning
Copy your Personal Access Token value now. You won’t be able to see it again!
-
Create Repository Secrets 🤐
-
{Cloned_Repo_Name} > Settings > Secrets and Variables > Actions -
Create 2 Repository Secrets:
-
PERSONAL_ACCESS_TOKEN
Bearer {Personal_Access_Token_Value}
-
PERSONAL_USERNAME
{Your_Github_Username}
-
-
-
Profit 💸
-
Manual:
- Manual executions can be achieved by visiting the repository's
Actionssection, selecting theFollow-N-Star-Actionworkflow, and clickingRun Workflow
- Manual executions can be achieved by visiting the repository's
-
Scheduled:
- The program is scheduled to execute
@12pm every day. This can be changed in the.github/workflows/actions.ymlfile by adjusting theCron Expressionto fit your needs
- The program is scheduled to execute
on:
schedule:
- cron: '0 12 * * *' # run @12pm every day-
Environment Setup:
- ~8 seconds
-
Cost Per Follower:
- ~7.28 seconds
Important
API Limit: 5,000 requests per/Hour | Actions Allowance: 2,000 minutes (500MB) per/Month.
Using the new Personal Access Token created earlier for this repository, API rates will be limited to 5,000 requests per hour, as well as a 2,000 minute (500MB) free monthly Actions allowance. Currently, the program only has a protection in place to prevent exceeding the user API limit rate:
def check_user_api_info(self, threshold=4000):(line-97 in the model/github_api_client.py file, which can be increased), so it's advised that users keep track of their Actions usage. Adjusting the Cron Expression to execute the program less times a month can also help with this as well.
Tip
If the program stops early due to exceeding the API threshold, the workflow can be ran again after 1-hour once the user's API rate limit has refreshed, since the program saves explored profiles to file and continues with those not saved to file (as long as Actions minutes remain).
Cloning the project to your local machine may leave you with import errors in the python scripts. If your IDE does not automatically provide a solution for these, you will have to create a quick virtual environment in your project directory to install the requirements from the terminal & work from there.
Note
For this project, make sure your IDE's default interpreter uses the environment's python.exe once it's created.
-
Create Environment:
python -m venv venv -
Activate Environment:
source ./venv/Script/activate -
Verify Python & Pip Executables:
(venv) which python pip > .../venv/Scripts/python > .../venv/Scripts/pip -
Install Project Requirements:
(venv) pip install -r ./requirements.txtOnce complete, your import errors should be gone and all
project requirementscan be found in./venv/Lib/site-packages
For more information explaining previous topics and all documentation used for creating this project, the following links have been curated:
Grew tired of manually following users & starring more than 1 of their repos 😅
