This Python script updates all forked GitHub repositories by merging upstream changes.
- Python 3.x
requestslibrary (will be installed automatically in the workflow)
To run this script, you'll need to create a GitHub Personal Access Token with appropriate permissions. Follow these steps:
-
Sign in to GitHub: Log in to your GitHub account.
-
Navigate to Developer Settings:
- Click on your profile picture in the top-right corner.
- Go to Settings.
- In the left sidebar, scroll down and click on Developer settings.
-
Create a New Token:
- Click on Personal access tokens.
- Click on Tokens (classic), then Generate new token.
- Enter a note for the token (e.g., "Update Forks Script").
- Set the expiration period as per your needs (recommended: no expiration for long-term scripts).
- Select Scopes:
- Check the box for repo (this gives full control of private repositories) or just the scopes you need, such as repo:public if you only work with public repositories.
- Click Generate token.
-
Copy the Token: Make sure to copy the token as you won’t be able to see it again.
-
Fork this Repo: Make a fork of this repo.
-
Navigate to Github Actions: On the left window see a Script click there and input your credentials and hit run workflow.
- Clone this repository:
git clone https://github.com/yourusername/your-repo.git cd your-repo pip install requests python main.py <github_token> <github_username>
