Skip to content

Commit

Permalink
feat: use octokit-from-auth package
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Dec 15, 2024
1 parent 656beb4 commit 93fdb82
Show file tree
Hide file tree
Showing 6 changed files with 318 additions and 53 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@
npx prune-github-notifications
```

[`get-github-auth-token`](https://github.com/JoshuaKGoldberg/get-github-auth-token) is used to retrieve a GitHub auth token from `process.env.GH_TOKEN` or executing `gh auth token`.

### CLI Options

| Option | Type | Default | Description |
| ------------- | ---------- | -------------------------------------------------------------------- | ------------------------------------------------------------- |
| `--bandwidth` | `number` | `6` | Maximum parallel requests to start at once. |
| `--reason` | `string[]` | `["subscribed"]` | Notification reason(s) to filter to. |
| `--title` | `string[]` | `["^chore\(deps\): update .+ to", /^build\(deps-dev\): bump .+ to"]` | Notification title regular expressions to filter to. |
| `--watch` | `number` | `0` | A seconds interval to continuously re-run this on, if truthy. |
| Option | Type | Default | Description |
| ------------- | ---------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `--auth` | `string` | `process.env.GH_TOKEN` or executing `gh auth token` | Auth token for GitHub from [`octokit-from-auth`](https://github.com/JoshuaKGoldberg/octokit-from-auth). |
| `--bandwidth` | `number` | `6` | Maximum parallel requests to start at once. |
| `--reason` | `string[]` | `["subscribed"]` | Notification reason(s) to filter to. |
| `--title` | `string[]` | `["^chore\(deps\): update .+ to", /^build\(deps-dev\): bump .+ to"]` | Notification title regular expressions to filter to. |
| `--watch` | `number` | `0` | A seconds interval to continuously re-run this on, if truthy. |

For example, providing all options on the CLI:
For example, providing all functional options on the CLI:

```shell
npx prune-github-notifications --bandwidth 10 --reason subscribed --title "^chore.+ update .+ to"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
},
"dependencies": {
"chalk": "^5.3.0",
"get-github-auth-token": "^0.1.0",
"octokit": "^3.1.2",
"octokit-from-auth": "^0.2.0",
"throttled-queue": "^2.1.4",
"zod": "^3.22.4"
},
Expand Down
Loading

0 comments on commit 93fdb82

Please sign in to comment.