From 9f1f4b3571bb4b2cd6515ee704a9563d8845bb9b Mon Sep 17 00:00:00 2001 From: Nick Rakochy Date: Wed, 15 Mar 2023 09:03:30 -0500 Subject: [PATCH] feature: Add CCI_HOST env to allow configurable host (#42) Co-authored-by: Nick Rakochy --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 942344d..9a44648 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,7 @@ import axios from "axios"; startGroup("Preparing CircleCI Pipeline Trigger"); const repoOrg = context.repo.owner; const repoName = context.repo.repo; +const host = `${process.env.CCI_HOST}` || "circleci.com"; info(`Org: ${repoOrg}`); info(`Repo: ${repoName}`); const ref = context.ref; @@ -63,7 +64,7 @@ if (tag) { Object.assign(body, { branch }); } -const url = `https://circleci.com/api/v2/project/gh/${repoOrg}/${repoName}/pipeline`; +const url = `https://${host}/api/v2/project/gh/${repoOrg}/${repoName}/pipeline`; info(`Triggering CircleCI Pipeline for ${repoOrg}/${repoName}`); info(`Triggering URL: ${url}`);