Skip to content

Commit

Permalink
feature: Add CCI_HOST env to allow configurable host (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Rakochy <[email protected]>
  • Loading branch information
nrakochy and Nick Rakochy authored Mar 15, 2023
1 parent f8d9ba6 commit 9f1f4b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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}`);
Expand Down

0 comments on commit 9f1f4b3

Please sign in to comment.