Skip to content

Commit

Permalink
feat: use octokit-from-auth package (#185)
Browse files Browse the repository at this point in the history
## PR Checklist

- [x] Addresses an existing open issue: fixes #184
- [x] That issue was marked as [`status: accepting
prs`](/~https://github.com/JoshuaKGoldberg/prune-github-notifications/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](/~https://github.com/JoshuaKGoldberg/prune-github-notifications/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

Adds and documents using `octokit-from-auth`.

💖
  • Loading branch information
JoshuaKGoldberg authored Dec 15, 2024
1 parent 656beb4 commit 2e05cbc
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 284 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
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
},
"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 2e05cbc

Please sign in to comment.