From 2f6fe3ff5226a71a0a20cb381bb048eae56dc2c5 Mon Sep 17 00:00:00 2001 From: Adrien Beaudouin Date: Thu, 22 Aug 2024 20:58:11 +0200 Subject: [PATCH] init auto release project --- release/action.yaml | 3 +++ release/dist/index.js | 9 ++++++--- release/index.js | 9 ++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/release/action.yaml b/release/action.yaml index 6ebcb14..da28d65 100644 --- a/release/action.yaml +++ b/release/action.yaml @@ -16,6 +16,9 @@ inputs: target-commitish: description: "Commitish value that determines where the Git tag is created from" default: "main" + prerelease: + description: "Whether the release is a prerelease" + default: "false" runs: using: node20 diff --git a/release/dist/index.js b/release/dist/index.js index fd94602..f63f4bc 100644 --- a/release/dist/index.js +++ b/release/dist/index.js @@ -33253,6 +33253,7 @@ async function run() { const token = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput("token"); const repository = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput("repository"); const target_commitish = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput("target-commitish"); + const prerelease = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput("prerelease") === "true"; const [owner, repo] = repository.split("/"); @@ -33272,9 +33273,11 @@ async function run() { let response = await client.repository.repoCreateRelease({ owner, repo, - tag_name: newVersion, - target_commitish, - name: newVersion, + body: { + tag_name: newVersion, + target_commitish, + prerelease, + }, }); console.log(`🎉 Release ready at ${response.html_url}`); } catch (error) { diff --git a/release/index.js b/release/index.js index 78477cc..c0a03da 100644 --- a/release/index.js +++ b/release/index.js @@ -8,6 +8,7 @@ async function run() { const token = core.getInput("token"); const repository = core.getInput("repository"); const target_commitish = core.getInput("target-commitish"); + const prerelease = core.getInput("prerelease") === "true"; const [owner, repo] = repository.split("/"); @@ -27,9 +28,11 @@ async function run() { let response = await client.repository.repoCreateRelease({ owner, repo, - tag_name: newVersion, - target_commitish, - name: newVersion, + body: { + tag_name: newVersion, + target_commitish, + prerelease, + }, }); console.log(`🎉 Release ready at ${response.html_url}`); } catch (error) {