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-102 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 will leave you with import errors & an inability for the program to access your github secrets. To remedy this, you need to create a quick virtual environment to install the project requirements, as well as a .env file containing your github secrets that can be accessed locally by the program as environment variables. Both will be located in your project's root directory. NOTE: options within { } are possible commands & outputs, so choose whichever relates to your setup.
Warning
Ensure venv directories & .env files are being ignored by git before pushing changes to your repository!
- Create Environment:
{python|python3} -m venv venv - Activate Environment:
source ./venv/{bin|Scripts}/activate - Verify Python & Pip Executables:
(venv) which python pip > .../venv/{bin|Scripts}/python > .../venv/{bin|Scripts}/pip - Install Project Requirements:
(venv) pip install -r ./requirements.txt
Note
To consolidate project requirements, set your IDE's default interpreter to the environment's python.exe.
-
Create a .env File with your Repository Secrets:
PERSONAL_USERNAME = "{Your_Github_Username}" PERSONAL_ACCESS_TOKEN = "Bearer {Personal_Access_Token_Value}"Once complete, import errors will be gone & the program should run with successful Github API authentication. All
project requirementscan then 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 😅
