Skip to main content

releases

Creates, updates, deletes, gets or lists a releases resource.

Overview

Namereleases
TypeResource
Idgithub.repos.releases

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
namestring
node_idstring
tag_namestringThe name of the tag. (example: v1.0.0)
assetsarray
assets_urlstring (uri)
authorobjectA GitHub user. (title: Simple User)
bodystring
body_htmlstring
body_textstring
created_atstring (date-time)
discussion_urlstring (uri)The URL of the release discussion.
draftbooleantrue to create a draft (unpublished) release, false to create a published one.
html_urlstring (uri)
immutablebooleanWhether or not the release is immutable.
mentions_countinteger
prereleasebooleanWhether to identify the release as a prerelease or a full release.
published_atstring (date-time)
reactionsobject (title: Reaction Rollup)
tarball_urlstring (uri)
target_commitishstringSpecifies the commitish value that determines where the Git tag is created from. (example: master)
updated_atstring (date-time)
upload_urlstring
urlstring (uri)
zipball_urlstring (uri)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_release_by_tagselectowner, repo, tagGet a published release with the specified tag.
get_releaseselectowner, repo, release_idGets a public release with the specified release ID.

> [!NOTE]
> This returns an upload_url key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see "Getting started with the REST API."
list_releasesselectowner, repoper_page, pageThis returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API.

Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.
create_releaseinsertowner, repo, tag_nameUsers with push access to the repository can create a release.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."
update_releaseupdateowner, repo, release_idUsers with push access to the repository can edit a release.
delete_releasedeleteowner, repo, release_idUsers with push access to the repository can delete a release.
generate_release_notesexecowner, repo, tag_nameGenerate a name and body describing a release. The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ownerstringThe account owner of the repository. The name is not case sensitive.
release_idintegerThe unique identifier of the release.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
tagstringtag parameter
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Get a published release with the specified tag.

SELECT
id,
name,
node_id,
tag_name,
assets,
assets_url,
author,
body,
body_html,
body_text,
created_at,
discussion_url,
draft,
html_url,
immutable,
mentions_count,
prerelease,
published_at,
reactions,
tarball_url,
target_commitish,
updated_at,
upload_url,
url,
zipball_url
FROM github.repos.releases
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND tag = '{{ tag }}' -- required
;

INSERT examples

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

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."

INSERT INTO github.repos.releases (
tag_name,
target_commitish,
name,
body,
draft,
prerelease,
discussion_category_name,
generate_release_notes,
make_latest,
owner,
repo
)
SELECT
'{{ tag_name }}' /* required */,
'{{ target_commitish }}',
'{{ name }}',
'{{ body }}',
{{ draft }},
{{ prerelease }},
'{{ discussion_category_name }}',
{{ generate_release_notes }},
'{{ make_latest }}',
'{{ owner }}',
'{{ repo }}'
RETURNING
id,
name,
node_id,
tag_name,
assets,
assets_url,
author,
body,
body_html,
body_text,
created_at,
discussion_url,
draft,
html_url,
immutable,
mentions_count,
prerelease,
published_at,
reactions,
tarball_url,
target_commitish,
updated_at,
upload_url,
url,
zipball_url
;

UPDATE examples

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

UPDATE github.repos.releases
SET
tag_name = '{{ tag_name }}',
target_commitish = '{{ target_commitish }}',
name = '{{ name }}',
body = '{{ body }}',
draft = {{ draft }},
prerelease = {{ prerelease }},
make_latest = '{{ make_latest }}',
discussion_category_name = '{{ discussion_category_name }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND release_id = '{{ release_id }}' --required
RETURNING
id,
name,
node_id,
tag_name,
assets,
assets_url,
author,
body,
body_html,
body_text,
created_at,
discussion_url,
draft,
html_url,
immutable,
mentions_count,
prerelease,
published_at,
reactions,
tarball_url,
target_commitish,
updated_at,
upload_url,
url,
zipball_url;

DELETE examples

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

DELETE FROM github.repos.releases
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND release_id = '{{ release_id }}' --required
;

Lifecycle Methods

Generate a name and body describing a release. The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release.

EXEC github.repos.releases.generate_release_notes 
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required
@@json=
'{
"tag_name": "{{ tag_name }}",
"target_commitish": "{{ target_commitish }}",
"previous_tag_name": "{{ previous_tag_name }}",
"configuration_file_path": "{{ configuration_file_path }}"
}'
;