feat: add merge/close PR buttons to Discord PR notifications

This commit is contained in:
RhenCloud 2026-08-02 23:02:37 +08:00
parent d40f34cc4d
commit 44b8fead78
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
9 changed files with 223 additions and 3 deletions

View file

@ -1,6 +1,6 @@
# Actions
User action endpoints allow commenting on issues, merging PRs, and adding reactions. All action endpoints require a valid Bearer token from the OAuth flow.
User action endpoints allow commenting on issues, merging/closing PRs, and adding reactions. All action endpoints require a valid Bearer token from the OAuth flow.
## Authentication
@ -70,6 +70,32 @@ Merges a pull request.
**Response:** `200` with GitHub merge response.
### Close Pull Request
```
POST /api/close
```
Closes a pull request without merging.
**Request Body:**
```json
{
"owner": "org",
"repo": "repo",
"pullNumber": 42
}
```
| Field | Type | Required | Description |
| ------------ | ------ | -------- | ----------------------- |
| `owner` | string | Yes | Repository owner |
| `repo` | string | Yes | Repository name |
| `pullNumber` | number | Yes | Pull request number |
**Response:** `200` with GitHub update response.
### Add Reaction
```

View file

@ -19,6 +19,7 @@ https://your-worker.workers.dev
| `DELETE` | `/auth/token/:userId` | None | Revoke user token |
| `POST` | `/api/comment` | Bearer token | Create issue comment |
| `POST` | `/api/merge` | Bearer token | Merge pull request |
| `POST` | `/api/close` | Bearer token | Close pull request |
| `POST` | `/api/react` | Bearer token | Add reaction to issue |
| `GET` | `/admin` | Admin session | Config console UI |
| `GET` | `/admin/api/routes` | Admin session | List routes |