Skip to content

Commit 1657feb

Browse files
committed
Add create_release, update_release, delete_release, generate_release_notes tools
Adds four tools that round out release management, which previously only had read tools (list_releases, get_latest_release, get_release_by_tag): - create_release: POST /repos/{owner}/{repo}/releases - update_release: PATCH /repos/{owner}/{repo}/releases/{release_id} - delete_release: DELETE /repos/{owner}/{repo}/releases/{release_id} (marked DestructiveHint, mirroring delete_file) - generate_release_notes: POST /repos/{owner}/{repo}/releases/generate-notes, a preview-only endpoint that generates release notes from merged PRs without creating or modifying a release update_release follows the same partial-update pattern as update_pull_request (OptionalParamOK per field, no-op error if nothing is provided).
1 parent c36e4e4 commit 1657feb

9 files changed

Lines changed: 1273 additions & 3 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,20 @@ The following sets of tools are available:
12601260
- `repo`: Repository name (string, required)
12611261
- `sha`: The blob SHA of the file being replaced. Required if the file already exists. (string, optional)
12621262

1263+
- **create_release** - Create release
1264+
- **Required OAuth Scopes**: `repo`
1265+
- `body`: Text describing the release. If generate_release_notes is true, this is prepended to the automatically generated notes. (string, optional)
1266+
- `discussion_category_name`: Name of a discussion category in the repository to start a discussion for the release in (string, optional)
1267+
- `draft`: Save the release as a draft instead of publishing it (boolean, optional)
1268+
- `generate_release_notes`: Whether to automatically generate the name and body for this release based on merged pull requests since the last release (boolean, optional)
1269+
- `make_latest`: Whether this release should be marked as the latest release for the repository (string, optional)
1270+
- `name`: Release title (string, optional)
1271+
- `owner`: Repository owner (string, required)
1272+
- `prerelease`: Mark the release as a prerelease (boolean, optional)
1273+
- `repo`: Repository name (string, required)
1274+
- `tag_name`: Tag name for the release (e.g., 'v1.0.0'). Created automatically if it doesn't already exist. (string, required)
1275+
- `target_commitish`: Branch, tag, or commit SHA the Git tag is created from if tag_name doesn't already exist. Defaults to the repository's default branch. (string, optional)
1276+
12631277
- **create_repository** - Create repository
12641278
- **Required OAuth Scopes**: `repo`
12651279
- `autoInit`: Initialize with README (boolean, optional)
@@ -1276,12 +1290,27 @@ The following sets of tools are available:
12761290
- `path`: Path to the file to delete (string, required)
12771291
- `repo`: Repository name (string, required)
12781292

1293+
- **delete_release** - Delete release
1294+
- **Required OAuth Scopes**: `repo`
1295+
- `owner`: Repository owner (string, required)
1296+
- `release_id`: The unique identifier of the release to delete (number, required)
1297+
- `repo`: Repository name (string, required)
1298+
12791299
- **fork_repository** - Fork repository
12801300
- **Required OAuth Scopes**: `repo`
12811301
- `organization`: Organization to fork to (string, optional)
12821302
- `owner`: Repository owner (string, required)
12831303
- `repo`: Repository name (string, required)
12841304

1305+
- **generate_release_notes** - Generate release notes
1306+
- **Required OAuth Scopes**: `repo`
1307+
- `configuration_file_path`: Path to a release-notes configuration file in the repository, relative to the repository root (e.g., '.github/release.yml'), to use instead of the default configuration (string, optional)
1308+
- `owner`: Repository owner (string, required)
1309+
- `previous_tag_name`: The name of the previous tag to use as the starting point for the release notes. If omitted, GitHub uses the tag that immediately precedes tag_name chronologically. (string, optional)
1310+
- `repo`: Repository name (string, required)
1311+
- `tag_name`: The tag name for the release whose notes are being generated. This doesn't need to exist yet. (string, required)
1312+
- `target_commitish`: Branch, tag, or commit SHA the Git tag is created from if tag_name doesn't already exist. Defaults to the repository's default branch. (string, optional)
1313+
12851314
- **get_commit** - Get commit details
12861315
- **Required OAuth Scopes**: `repo`
12871316
- `detail`: Level of detail to include for changed files. "none" omits stats and files entirely. "stats" (default) includes per-file metadata: filename, status, and lines-of-code counts (additions, deletions, changes), with no patch content. "full_patch" additionally includes the unified diff content for each file and can be very large. (string, optional)
@@ -1390,6 +1419,20 @@ The following sets of tools are available:
13901419
- `query`: Repository search query. Examples: 'machine learning in:name stars:>1000 language:python', 'topic:react', 'user:facebook'. Supports advanced search syntax for precise filtering. (string, required)
13911420
- `sort`: Sort repositories by field, defaults to best match (string, optional)
13921421

1422+
- **update_release** - Update release
1423+
- **Required OAuth Scopes**: `repo`
1424+
- `body`: Text describing the release (string, optional)
1425+
- `discussion_category_name`: Name of a discussion category in the repository to start a discussion for the release in. Can only be set once, when the release is published for the first time. (string, optional)
1426+
- `draft`: Whether the release should be a draft (unpublished) (boolean, optional)
1427+
- `make_latest`: Whether this release should be marked as the latest release for the repository (string, optional)
1428+
- `name`: Release title (string, optional)
1429+
- `owner`: Repository owner (string, required)
1430+
- `prerelease`: Whether the release should be marked as a prerelease (boolean, optional)
1431+
- `release_id`: The unique identifier of the release to update (number, required)
1432+
- `repo`: Repository name (string, required)
1433+
- `tag_name`: New tag name for the release (string, optional)
1434+
- `target_commitish`: Branch, tag, or commit SHA the Git tag is created from if the tag doesn't already exist (string, optional)
1435+
13931436
</details>
13941437

13951438
<details>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"annotations": {
3+
"idempotentHint": false,
4+
"readOnlyHint": false,
5+
"title": "Create release"
6+
},
7+
"description": "Create a new release in a GitHub repository",
8+
"inputSchema": {
9+
"properties": {
10+
"body": {
11+
"description": "Text describing the release. If generate_release_notes is true, this is prepended to the automatically generated notes.",
12+
"type": "string"
13+
},
14+
"discussion_category_name": {
15+
"description": "Name of a discussion category in the repository to start a discussion for the release in",
16+
"type": "string"
17+
},
18+
"draft": {
19+
"description": "Save the release as a draft instead of publishing it",
20+
"type": "boolean"
21+
},
22+
"generate_release_notes": {
23+
"description": "Whether to automatically generate the name and body for this release based on merged pull requests since the last release",
24+
"type": "boolean"
25+
},
26+
"make_latest": {
27+
"description": "Whether this release should be marked as the latest release for the repository",
28+
"enum": [
29+
"true",
30+
"false",
31+
"legacy"
32+
],
33+
"type": "string"
34+
},
35+
"name": {
36+
"description": "Release title",
37+
"type": "string"
38+
},
39+
"owner": {
40+
"description": "Repository owner",
41+
"type": "string"
42+
},
43+
"prerelease": {
44+
"description": "Mark the release as a prerelease",
45+
"type": "boolean"
46+
},
47+
"repo": {
48+
"description": "Repository name",
49+
"type": "string"
50+
},
51+
"tag_name": {
52+
"description": "Tag name for the release (e.g., 'v1.0.0'). Created automatically if it doesn't already exist.",
53+
"type": "string"
54+
},
55+
"target_commitish": {
56+
"description": "Branch, tag, or commit SHA the Git tag is created from if tag_name doesn't already exist. Defaults to the repository's default branch.",
57+
"type": "string"
58+
}
59+
},
60+
"required": [
61+
"owner",
62+
"repo",
63+
"tag_name"
64+
],
65+
"type": "object"
66+
},
67+
"name": "create_release"
68+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": true,
4+
"idempotentHint": false,
5+
"readOnlyHint": false,
6+
"title": "Delete release"
7+
},
8+
"description": "Delete a release from a GitHub repository. This does not delete the underlying Git tag.",
9+
"inputSchema": {
10+
"properties": {
11+
"owner": {
12+
"description": "Repository owner",
13+
"type": "string"
14+
},
15+
"release_id": {
16+
"description": "The unique identifier of the release to delete",
17+
"type": "number"
18+
},
19+
"repo": {
20+
"description": "Repository name",
21+
"type": "string"
22+
}
23+
},
24+
"required": [
25+
"owner",
26+
"repo",
27+
"release_id"
28+
],
29+
"type": "object"
30+
},
31+
"name": "delete_release"
32+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"annotations": {
3+
"idempotentHint": false,
4+
"readOnlyHint": true,
5+
"title": "Generate release notes"
6+
},
7+
"description": "Generate the name and body text for a release, based on merged pull requests since the last release, without creating or modifying a release",
8+
"inputSchema": {
9+
"properties": {
10+
"configuration_file_path": {
11+
"description": "Path to a release-notes configuration file in the repository, relative to the repository root (e.g., '.github/release.yml'), to use instead of the default configuration",
12+
"type": "string"
13+
},
14+
"owner": {
15+
"description": "Repository owner",
16+
"type": "string"
17+
},
18+
"previous_tag_name": {
19+
"description": "The name of the previous tag to use as the starting point for the release notes. If omitted, GitHub uses the tag that immediately precedes tag_name chronologically.",
20+
"type": "string"
21+
},
22+
"repo": {
23+
"description": "Repository name",
24+
"type": "string"
25+
},
26+
"tag_name": {
27+
"description": "The tag name for the release whose notes are being generated. This doesn't need to exist yet.",
28+
"type": "string"
29+
},
30+
"target_commitish": {
31+
"description": "Branch, tag, or commit SHA the Git tag is created from if tag_name doesn't already exist. Defaults to the repository's default branch.",
32+
"type": "string"
33+
}
34+
},
35+
"required": [
36+
"owner",
37+
"repo",
38+
"tag_name"
39+
],
40+
"type": "object"
41+
},
42+
"name": "generate_release_notes"
43+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"annotations": {
3+
"idempotentHint": false,
4+
"readOnlyHint": false,
5+
"title": "Update release"
6+
},
7+
"description": "Update an existing release in a GitHub repository",
8+
"inputSchema": {
9+
"properties": {
10+
"body": {
11+
"description": "Text describing the release",
12+
"type": "string"
13+
},
14+
"discussion_category_name": {
15+
"description": "Name of a discussion category in the repository to start a discussion for the release in. Can only be set once, when the release is published for the first time.",
16+
"type": "string"
17+
},
18+
"draft": {
19+
"description": "Whether the release should be a draft (unpublished)",
20+
"type": "boolean"
21+
},
22+
"make_latest": {
23+
"description": "Whether this release should be marked as the latest release for the repository",
24+
"enum": [
25+
"true",
26+
"false",
27+
"legacy"
28+
],
29+
"type": "string"
30+
},
31+
"name": {
32+
"description": "Release title",
33+
"type": "string"
34+
},
35+
"owner": {
36+
"description": "Repository owner",
37+
"type": "string"
38+
},
39+
"prerelease": {
40+
"description": "Whether the release should be marked as a prerelease",
41+
"type": "boolean"
42+
},
43+
"release_id": {
44+
"description": "The unique identifier of the release to update",
45+
"type": "number"
46+
},
47+
"repo": {
48+
"description": "Repository name",
49+
"type": "string"
50+
},
51+
"tag_name": {
52+
"description": "New tag name for the release",
53+
"type": "string"
54+
},
55+
"target_commitish": {
56+
"description": "Branch, tag, or commit SHA the Git tag is created from if the tag doesn't already exist",
57+
"type": "string"
58+
}
59+
},
60+
"required": [
61+
"owner",
62+
"repo",
63+
"release_id"
64+
],
65+
"type": "object"
66+
},
67+
"name": "update_release"
68+
}

pkg/github/helper_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ const (
103103
PatchGistsByGistID = "PATCH /gists/{gist_id}"
104104

105105
// Releases endpoints
106-
GetReposReleasesByOwnerByRepo = "GET /repos/{owner}/{repo}/releases"
107-
GetReposReleasesLatestByOwnerByRepo = "GET /repos/{owner}/{repo}/releases/latest"
108-
GetReposReleasesTagsByOwnerByRepoByTag = "GET /repos/{owner}/{repo}/releases/tags/{tag}"
106+
GetReposReleasesByOwnerByRepo = "GET /repos/{owner}/{repo}/releases"
107+
GetReposReleasesLatestByOwnerByRepo = "GET /repos/{owner}/{repo}/releases/latest"
108+
GetReposReleasesTagsByOwnerByRepoByTag = "GET /repos/{owner}/{repo}/releases/tags/{tag}"
109+
PostReposReleasesByOwnerByRepo = "POST /repos/{owner}/{repo}/releases"
110+
PatchReposReleasesByOwnerByRepoByReleaseID = "PATCH /repos/{owner}/{repo}/releases/{release_id}"
111+
DeleteReposReleasesByOwnerByRepoByReleaseID = "DELETE /repos/{owner}/{repo}/releases/{release_id}"
112+
PostReposReleasesGenerateNotesByOwnerByRepo = "POST /repos/{owner}/{repo}/releases/generate-notes"
109113

110114
// Code quality endpoints
111115
GetReposCodeQualityFindingsByOwnerByRepoByFindingNumber = "GET /repos/{owner}/{repo}/code-quality/findings/{finding_number}"

0 commit comments

Comments
 (0)