Skip to content

Commit

Permalink
update README.md and example config file
Browse files Browse the repository at this point in the history
  • Loading branch information
nehzata committed Sep 27, 2023
1 parent fe2d307 commit 172193f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,40 @@ This project is a standalone worker that continuosly:
### Command line flags
```
➜ wkr-gh-sponsor git:(master) ./scripts/wkr-gh-sponsor --help
Usage: wkr-gh-sponsor --db-path="db.sql" --td-api-url="https://api.thanks.dev/v1/deps" --td-api-key=TD-API-KEY --gh-classic-access-token=GH-ACCESS-TOKEN --entities=ENTITIES,...
Usage: wkr-gh-sponsor --db-path="db.sql" --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).
--db-path="db.sql" Path to db file ($DB_PATH).
--td-api-url="https://api.thanks.dev/v1/deps"
thanks.dev API URL ($TD_API_URL).
--td-api-key=TD-API-KEY thanks.dev API key ($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.
--entities=ENTITIES,... The GitHub entities to process sponsorships for. First entity in the list is considered
DEFAULT.
--sponsor-amount=1 The amount to donate to each dependency
--wkr-td-disabled Disable worker.
--wkr-animate-disabled Disable worker.
--wkr-donate-disabled Disable worker.
Observability:
--log-level=info Log level (trace,debug,info,warning,error,fatal,panic).
--log-json Log in JSON format.
wkr-donate
--wkr-donate-disabled Flag to disable worker
--wkr-donate-work-interval=10s Sleep duration per run while processing
wkr-entities
--wkr-entities-disabled Flag to disable worker
--wkr-entities-work-interval=10s Sleep duration per run while processing
wkr-repos
--wkr-repos-disabled Flag to disable worker
--wkr-repos-work-interval=10s Sleep duration per run while processing
```

### Run locally
`. bin/activate-hermit`
`GH_CLASSIC_ACCESS_TOKEN=<TOKEN> ./scripts/wkr-gh-sponsor --config example.config.json`

### Docker & docker compose
A sample docker-compose.yml is provided to run this project.
```
Expand All @@ -40,10 +50,6 @@ cp example.config.json config.json # insert the github slugs of the user account
docker compose --env-file .env up -d wkr-gh-sponsor
```

### 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.
![image](https://github.com/thnxdev/wkr-gh-sponsor/assets/72539235/9ff22805-164d-47ba-a71a-07e7cb6d832a)

### 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.
![image](https://github.com/thnxdev/wkr-gh-sponsor/assets/72539235/69f248a8-2351-471e-84d5-43eeba9d3f5f)
Expand Down
9 changes: 7 additions & 2 deletions example.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"logLevel": "debug",
"entities": [
"getsentry",
"codecov"
]
"codecov",
"syntaxfm"
],
"wkr-donate": {
"disabled": true
}
}
1 change: 0 additions & 1 deletion example.env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
TD_API_KEY=<td api key goes here>
GH_CLASSIC_ACCESS_TOKEN=<github classic access token goes here>

0 comments on commit 172193f

Please sign in to comment.