Skip to content

A daily Github Actions program that helps users follow back their Github followers & star their top-4 repositories

License

Notifications You must be signed in to change notification settings

SVENTRIPIKAL/Github-Follow-N-Star-Action

Repository files navigation

Github-Follow-N-Star-Action ⭐

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.

Workflow Status Badge


Table of Contents

Initial Setup

  1. Clone The Repository 👨‍🔬

    • Deploy with Vercel
  2. Delete Data in your EXPLORED_LOGINS File 📄

  3. Create Github Actions Workflow 👨‍💻

    • Click Add File > Create New File in your Project Directory
    • Copy and Paste:
      • .github/workflows/actions.yml as the Name of your File
      • The Contents from actions.yml into your File
    • Click Commit Changes
  4. Grant Workflow Read/Write Permission ✍️

    • {Cloned_Repo_Name} > Settings > Actions > General
    • Scroll Down to Workflow Permissions
    • Click Read and Write Permissions
    • Click Save
  5. Create Personal Access Token 🥇

Warning

Copy your Personal Access Token value now. You won’t be able to see it again!

  1. Create Repository Secrets 🤐

    • {Cloned_Repo_Name} > Settings > Secrets and Variables > Actions

    • Create 2 Repository Secrets:

      1. PERSONAL_ACCESS_TOKEN

        • Bearer {Personal_Access_Token_Value}
      2. PERSONAL_USERNAME

        • {Your_Github_Username}
  2. Profit 💸


Running Actions Workflow

  • Manual:

    • Manual executions can be achieved by visiting the repository's Actions section, selecting the Follow-N-Star-Action workflow, and clicking Run Workflow
  • Scheduled:

    • The program is scheduled to execute @12pm every day. This can be changed in the .github/workflows/actions.yml file by adjusting the Cron Expression to fit your needs
on:
  schedule:
    - cron: '0 12 * * *'  # run @12pm every day

Actions Workflow Timing

  • Environment Setup:

    • ~8 seconds
  • Cost Per Follower:

    • ~7.28 seconds

Github API Rate Limit & Actions Allowance

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).


Running Project Locally

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.

  1. Create Environment:

    python -m venv venv
    
  2. Activate Environment:

    source ./venv/Script/activate
    
  3. Verify Python & Pip Executables:

    (venv)
    which python pip
    
    > .../venv/Scripts/python
    > .../venv/Scripts/pip
    
  4. Install Project Requirements:

    (venv)
    pip install -r ./requirements.txt
    

    Once complete, your import errors should be gone and all project requirements can be found in ./venv/Lib/site-packages


Output Example

Terminal Output Example


References

For more information explaining previous topics and all documentation used for creating this project, the following links have been curated:

Vercel
Personal Access Tokens
API Rates & Actions Allowances
REST API Endpoints & Practices
Github Actions
Python Virtual Environments

Inspiration

Grew tired of manually following users & starring more than 1 of their repos 😅

Releases

No releases published

Contributors 2

  •  
  •  

Languages