From 11f085915644a1e7a17cf620b85126eb9e06cd1b Mon Sep 17 00:00:00 2001 From: Samuel El-Borai Date: Thu, 24 Aug 2023 19:09:50 +0200 Subject: [PATCH] feat: add input branch-with-changes --- action.yml | 3 +++ dist/index.js | 7 +++++-- index.js | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 9c89cf0..662d009 100644 --- a/action.yml +++ b/action.yml @@ -13,3 +13,6 @@ inputs: stainless-api-key: description: 'The API key provided to you by Stainless' required: true + branch-with-changes: + description: 'Name of the branch that contains changes for the release.' + required: false \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 1b0e8e4..21d9268 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9933,7 +9933,7 @@ var __webpack_exports__ = {}; const core = __nccwpck_require__(2186); const fetch = (__nccwpck_require__(4429)/* ["default"] */ .ZP); -const BASE_URL = 'https://api.stainlessapi.com/api'; +const BASE_URL = 'https://api-im8l5axlc-stainless-api.vercel.app/api'; async function main() { const fullRepo = core.getInput('repo'); @@ -9948,13 +9948,16 @@ async function main() { throw new Error('Missing stainless-api-key input'); } - console.log(`Running Release Please with`, { owner, repo }); + const branchWithChanges = core.getInput('branch-with-changes'); + + console.log(`Running Release Please with`, { owner, repo, branchWithChanges }); const res = await fetch(`${BASE_URL}/trigger-release-please`, { method: 'POST', body: JSON.stringify({ owner, repo, + ...(branchWithChanges ? { branchWithChanges } : {}), }), headers: { Authorization: `Bearer ${apiKey}`, diff --git a/index.js b/index.js index 4ae566f..7961e89 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ const core = require('@actions/core'); const fetch = require('node-fetch').default; -const BASE_URL = 'https://api.stainlessapi.com/api'; +const BASE_URL = 'https://api-im8l5axlc-stainless-api.vercel.app/api'; async function main() { const fullRepo = core.getInput('repo'); @@ -16,13 +16,16 @@ async function main() { throw new Error('Missing stainless-api-key input'); } - console.log(`Running Release Please with`, { owner, repo }); + const branchWithChanges = core.getInput('branch-with-changes'); + + console.log(`Running Release Please with`, { owner, repo, branchWithChanges }); const res = await fetch(`${BASE_URL}/trigger-release-please`, { method: 'POST', body: JSON.stringify({ owner, repo, + ...(branchWithChanges ? { branchWithChanges } : {}), }), headers: { Authorization: `Bearer ${apiKey}`,