releases
Creates, updates, deletes, gets or lists a releases resource.
Overview
| Name | releases |
| Type | Resource |
| Id | github.repos.releases |
Fields
The following fields are returned by SELECT queries:
- get_release_by_tag
- get_release
- list_releases
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | |
node_id | string | |
tag_name | string | The name of the tag. (example: v1.0.0) |
assets | array | |
assets_url | string (uri) | |
author | object | A GitHub user. (title: Simple User) |
body | string | |
body_html | string | |
body_text | string | |
created_at | string (date-time) | |
discussion_url | string (uri) | The URL of the release discussion. |
draft | boolean | true to create a draft (unpublished) release, false to create a published one. |
html_url | string (uri) | |
immutable | boolean | Whether or not the release is immutable. |
mentions_count | integer | |
prerelease | boolean | Whether to identify the release as a prerelease or a full release. |
published_at | string (date-time) | |
reactions | object | (title: Reaction Rollup) |
tarball_url | string (uri) | |
target_commitish | string | Specifies the commitish value that determines where the Git tag is created from. (example: master) |
updated_at | string (date-time) | |
upload_url | string | |
url | string (uri) | |
zipball_url | string (uri) |
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."
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | |
node_id | string | |
tag_name | string | The name of the tag. (example: v1.0.0) |
assets | array | |
assets_url | string (uri) | |
author | object | A GitHub user. (title: Simple User) |
body | string | |
body_html | string | |
body_text | string | |
created_at | string (date-time) | |
discussion_url | string (uri) | The URL of the release discussion. |
draft | boolean | true to create a draft (unpublished) release, false to create a published one. |
html_url | string (uri) | |
immutable | boolean | Whether or not the release is immutable. |
mentions_count | integer | |
prerelease | boolean | Whether to identify the release as a prerelease or a full release. |
published_at | string (date-time) | |
reactions | object | (title: Reaction Rollup) |
tarball_url | string (uri) | |
target_commitish | string | Specifies the commitish value that determines where the Git tag is created from. (example: master) |
updated_at | string (date-time) | |
upload_url | string | |
url | string (uri) | |
zipball_url | string (uri) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
name | string | |
node_id | string | |
tag_name | string | The name of the tag. (example: v1.0.0) |
assets | array | |
assets_url | string (uri) | |
author | object | A GitHub user. (title: Simple User) |
body | string | |
body_html | string | |
body_text | string | |
created_at | string (date-time) | |
discussion_url | string (uri) | The URL of the release discussion. |
draft | boolean | true to create a draft (unpublished) release, false to create a published one. |
html_url | string (uri) | |
immutable | boolean | Whether or not the release is immutable. |
mentions_count | integer | |
prerelease | boolean | Whether to identify the release as a prerelease or a full release. |
published_at | string (date-time) | |
reactions | object | (title: Reaction Rollup) |
tarball_url | string (uri) | |
target_commitish | string | Specifies the commitish value that determines where the Git tag is created from. (example: master) |
updated_at | string (date-time) | |
upload_url | string | |
url | string (uri) | |
zipball_url | string (uri) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_release_by_tag | select | owner, repo, tag | Get a published release with the specified tag. | |
get_release | select | owner, repo, release_id | Gets 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_releases | select | owner, repo | per_page, page | This 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_release | insert | owner, repo, tag_name | Users with push access to the repository can create a release. > [!NOTE] > If the commit identified by target_commitish (or, when target_commitish is omitted, the latest commit on the default branch) 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".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_release | update | owner, repo, release_id | 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". | |
delete_release | delete | owner, repo, release_id | Users with push access to the repository can delete a release. | |
generate_release_notes | exec | owner, repo, tag_name | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
release_id | integer | The unique identifier of the release. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
tag | string | tag parameter |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_release_by_tag
- get_release
- list_releases
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
;
Gets 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."
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 release_id = '{{ release_id }}' -- required
;
This 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.
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 per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- create_release
- Manifest
Users with push access to the repository can create a release.
> [!NOTE]
> If the commit identified by target_commitish (or, when target_commitish is omitted, the latest commit on the default branch) 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".
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
;
# Description fields are for documentation purposes
- name: releases
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the releases resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the releases resource.
- name: tag_name
value: "{{ tag_name }}"
description: |
The name of the tag.
- name: target_commitish
value: "{{ target_commitish }}"
description: |
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.
- name: name
value: "{{ name }}"
description: |
The name of the release.
- name: body
value: "{{ body }}"
description: |
Text describing the contents of the tag.
- name: draft
value: {{ draft }}
description: |
`true` to create a draft (unpublished) release, `false` to create a published one.
default: false
- name: prerelease
value: {{ prerelease }}
description: |
`true` to identify the release as a prerelease. `false` to identify the release as a full release.
default: false
- name: discussion_category_name
value: "{{ discussion_category_name }}"
description: |
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. 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)."
- name: generate_release_notes
value: {{ generate_release_notes }}
description: |
Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes.
default: false
- name: make_latest
value: "{{ make_latest }}"
description: |
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.
valid_values: ['true', 'false', 'legacy']
default: true
UPDATE examples
- update_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".
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
- delete_release
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_release_notes
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 }}"
}'
;