From 606d12105c685a6d38b8cb713549e7ed8cfdce9c Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sat, 7 Oct 2023 18:49:27 +0200 Subject: [PATCH] :tada: Add host parameter --- action.yml | 4 ++++ index.js | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 90291f1..562e246 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,10 @@ inputs: message: description: 'The right text of the badge' required: true + host: + description: 'The base URL of the gist API' + default: 'https://api.github.com/gists/' + required: false forceUpdate: description: 'If set to true, the gist will be updated even if the content did not change' default: 'false' diff --git a/index.js b/index.js index 7cea9db..0432a64 100644 --- a/index.js +++ b/index.js @@ -7,10 +7,7 @@ import core from '@actions/core'; import { makeBadge } from 'badge-maker'; -const gistUrl = new URL( - core.getInput('gistID'), - 'https://api.github.com/gists/' -); +const gistUrl = new URL(core.getInput('gistID'), core.getInput('host')); // This uses the method above to update a gist with the given data. The user agent is // required as defined in https://developer.github.com/v3/#user-agent-required