Sample - GitHub REST API
PATCH/repos/{owner}/{repo}/releases/{release_id}

Update a release

Users with push access to the repository can edit a release.

[!NOTE] If the resolved target commit (the new value of target_commitish if you are changing it, otherwise the existing target) adds or modifies any file under .github/workflows/ relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns 404 Not Found; some authentication paths surface 403 Resource not accessible by integration instead.

OAuth app tokens and personal access tokens (classic) need the workflow scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The GITHUB_TOKEN available to GitHub Actions cannot be authorized for this; for more information, see "Automatic token authentication".

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters · 8 body fields
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
release_idintegerrequired
The unique identifier of the release.
tag_namestringoptional
The name of the tag.
target_commitishstringoptional
Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch.
namestringoptional
The name of the release.
bodystringoptional
Text describing the contents of the tag.
draftbooleanoptional
`true` makes the release a draft, and `false` publishes the release.
prereleasebooleanoptional
`true` to identify the release as a prerelease, `false` to identify the release as a full release.
make_lateststringoptional
Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to `true` for newly published releases. `legacy` specifies that the latest release should be determined based on the release creation date and higher semantic version.
Allowed:truefalselegacyDefault:true
discussion_category_namestringoptional
If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)."

2 status codes
200Response
urlstringrequired
html_urlstringrequired
assets_urlstringrequired
upload_urlstringrequired
tarball_urlstringrequired
zipball_urlstringrequired
idintegerrequired
node_idstringrequired
tag_namestringrequired
The name of the tag.
target_commitishstringrequired
Specifies the commitish value that determines where the Git tag is created from.
namestringrequired
bodystringoptional
draftbooleanrequired
true to create a draft (unpublished) release, false to create a published one.
prereleasebooleanrequired
Whether to identify the release as a prerelease or a full release.
immutablebooleanoptional
Whether or not the release is immutable.
created_atstringrequired
published_atstringrequired
updated_atstringoptional
authorobjectrequired
A GitHub user.
assetsarray<ReleaseAsset>required
body_htmlstringoptional
body_textstringoptional
mentions_countintegeroptional
discussion_urlstringoptional
The URL of the release discussion.
reactionsobjectoptional
404Not Found if the discussion category name is invalid
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned: Not Found if the discussion category name is invalid.