https://github.com/thnxdev/utils
Mass GH Sponsors donor
https://github.com/thnxdev/utils
Last synced: 1 day ago
JSON representation
Mass GH Sponsors donor
- Host: GitHub
- URL: https://github.com/thnxdev/utils
- Owner: thnxdev
- Created: 2023-09-17T10:50:26.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T22:44:34.000Z (about 2 years ago)
- Last Synced: 2025-10-19T16:49:31.919Z (3 months ago)
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 1
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# thanks.dev utils
This repository contains the following tools:
- auto-boost: used to automatically boost any GH repository that has a "tag-production" topic associated to +2
- mass-gh-sponsor: used to set up monthly GH sponsorships for all dependencies
## 1. auto-boost
```
utils git:(master) ✗ ./scripts/auto-boost --help
Usage: auto-boost --td-api-url="https://api.thanks.dev" --td-api-key=TD-API-KEY --gh-classic-access-token=GH-ACCESS-TOKEN --entities=ENTITIES,...
Flags:
-h, --help Show context-sensitive help.
-v, --version Print version and exit.
-C, --config=FILE Config file ($CONFIG_PATH).
--td-api-url="https://api.thanks.dev" API path for thanks.dev ($TD_API_URL).
--td-api-key=TD-API-KEY API key for thanks.dev ($TD_API_KEY).
--gh-classic-access-token=GH-ACCESS-TOKEN
GitHub classis access token with admin:org & user scopes
($GH_CLASSIC_ACCESS_TOKEN).
--entities=ENTITIES,... The GitHub entities to process sponsorships for. First entity in the list
is considered DEFAULT.
Observability:
--log-level=info Log level (trace,debug,info,warning,error,fatal,panic).
--log-json Log in JSON format.
```
### Run locally
`. bin/activate-hermit`
`TD_API_KEY= GH_CLASSIC_ACCESS_TOKEN= ./scripts/auto-boost --config example.config.json`
## 2. mass-gh-sponsor
```
➜ utils git:(master) ./scripts/mass-gh-sponsor --help
Usage: mass-gh-sponsor --db-path="db.sql"
Flags:
-h, --help Show context-sensitive help.
-v, --version Print version and exit.
-C, --config=FILE Config file ($CONFIG_PATH).
--db-path="db.sql" Path to db file ($DB_PATH).
Observability:
--log-level=info Log level (trace,debug,info,warning,error,fatal,panic).
--log-json Log in JSON format.
Commands:
import-csv Import list of donations from csv file.
dl-repos Import the user's github repos.
animate-repos Animate the sponsorable dependencies for each repo.
donate Create the require GitHub sponsorships.
Run "mass-gh-sponsor --help" for more information on a command.
```
### 2.1 Run locally (import from gh)
`. bin/activate-hermit`
`GH_CLASSIC_ACCESS_TOKEN= ./scripts/mass-gh-sponsor --log-level=debug dl-repos --entities=syntaxfm`
`GH_CLASSIC_ACCESS_TOKEN= ./scripts/mass-gh-sponsor --log-level=debug animate-repos`
`GH_CLASSIC_ACCESS_TOKEN= ./scripts/mass-gh-sponsor --log-level=debug donate`
### 2.2 Run locally (import from csv)
`. bin/activate-hermit`
`GH_CLASSIC_ACCESS_TOKEN= ./scripts/mass-gh-sponsor --log-level=debug import-csv --entity=syntaxfm --file-path=`
`GH_CLASSIC_ACCESS_TOKEN= ./scripts/mass-gh-sponsor --log-level=debug donate`
## 3. TD-API-KEY
To obtain a thanks.dev API key, log into thanks.dev and visit the settings screen. The API key configurations are located towards the bottom of the screen.

## 4. GH-ACCESS-TOKEN
Ensure you create a classic GH access token with `admin:org` and `user` scopes configured. Set a custom expiration date to one day after the last expected donation date.

**Ensure you keep the token stored securely**
Unfortunately, these are the minimum scopes that can create a sponsorship via the GH GraphQL API and they contain write permissions on your account.