Ability to create draft releases

This commit is contained in:
ShonP40 2023-09-04 10:06:26 +03:00
parent 1beeb572c1
commit e3374ce5b6
No known key found for this signature in database
GPG Key ID: 3DF8A3630CD54CE1
2 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,8 @@ inputs:
description: 'Promote a prerelease to release. Defaults to "false".'
file_glob:
description: 'If true the file can be a glob pattern, asset_name is ignored if this is true.'
draft:
description: 'Mark the release as a draft. Defaults to "false".'
prerelease:
description: 'Mark the release as a pre-release. Defaults to "false".'
make_latest:

View File

@ -28,6 +28,7 @@ type UpdateReleaseParams = Endpoints[typeof updateRelease]['parameters']
async function get_release_by_tag(
tag: string,
draft: boolean,
prerelease: boolean,
make_latest: boolean,
release_name: string,
@ -68,6 +69,7 @@ async function get_release_by_tag(
return await octokit.request(createRelease, {
...repo(),
tag_name: tag,
draft: draft,
prerelease: prerelease,
make_latest: make_latest ? 'true' : 'false',
name: release_name,
@ -209,6 +211,7 @@ async function run(): Promise<void> {
const file_glob = core.getInput('file_glob') == 'true' ? true : false
const overwrite = core.getInput('overwrite') == 'true' ? true : false
const promote = core.getInput('promote') == 'true' ? true : false
const draft = core.getInput('draft') == 'true' ? true : false
const prerelease = core.getInput('prerelease') == 'true' ? true : false
const make_latest = core.getInput('make_latest') != 'false' ? true : false
const release_name = core.getInput('release_name')
@ -222,6 +225,7 @@ async function run(): Promise<void> {
const octokit = github.getOctokit(token)
const release = await get_release_by_tag(
tag,
draft,
prerelease,
make_latest,
release_name,