@@ -17568,12 +17568,12 @@ var require_lib = __commonJS({
1756817568 throw new Error("Client has already been disposed.");
1756917569 }
1757017570 const parsedUrl = new URL(requestUrl);
17571- let info = this._prepareRequest(verb, parsedUrl, headers);
17571+ let info2 = this._prepareRequest(verb, parsedUrl, headers);
1757217572 const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
1757317573 let numTries = 0;
1757417574 let response;
1757517575 do {
17576- response = yield this.requestRaw(info , data);
17576+ response = yield this.requestRaw(info2 , data);
1757717577 if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
1757817578 let authenticationHandler;
1757917579 for (const handler of this.handlers) {
@@ -17583,7 +17583,7 @@ var require_lib = __commonJS({
1758317583 }
1758417584 }
1758517585 if (authenticationHandler) {
17586- return authenticationHandler.handleAuthentication(this, info , data);
17586+ return authenticationHandler.handleAuthentication(this, info2 , data);
1758717587 } else {
1758817588 return response;
1758917589 }
@@ -17606,8 +17606,8 @@ var require_lib = __commonJS({
1760617606 }
1760717607 }
1760817608 }
17609- info = this._prepareRequest(verb, parsedRedirectUrl, headers);
17610- response = yield this.requestRaw(info , data);
17609+ info2 = this._prepareRequest(verb, parsedRedirectUrl, headers);
17610+ response = yield this.requestRaw(info2 , data);
1761117611 redirectsRemaining--;
1761217612 }
1761317613 if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
@@ -17636,7 +17636,7 @@ var require_lib = __commonJS({
1763617636 * @param info
1763717637 * @param data
1763817638 */
17639- requestRaw(info , data) {
17639+ requestRaw(info2 , data) {
1764017640 return __awaiter(this, void 0, void 0, function* () {
1764117641 return new Promise((resolve, reject) => {
1764217642 function callbackForResult(err, res) {
@@ -17648,7 +17648,7 @@ var require_lib = __commonJS({
1764817648 resolve(res);
1764917649 }
1765017650 }
17651- this.requestRawWithCallback(info , data, callbackForResult);
17651+ this.requestRawWithCallback(info2 , data, callbackForResult);
1765217652 });
1765317653 });
1765417654 }
@@ -17658,12 +17658,12 @@ var require_lib = __commonJS({
1765817658 * @param data
1765917659 * @param onResult
1766017660 */
17661- requestRawWithCallback(info , data, onResult) {
17661+ requestRawWithCallback(info2 , data, onResult) {
1766217662 if (typeof data === "string") {
17663- if (!info .options.headers) {
17664- info .options.headers = {};
17663+ if (!info2 .options.headers) {
17664+ info2 .options.headers = {};
1766517665 }
17666- info .options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
17666+ info2 .options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
1766717667 }
1766817668 let callbackCalled = false;
1766917669 function handleResult(err, res) {
@@ -17672,7 +17672,7 @@ var require_lib = __commonJS({
1767217672 onResult(err, res);
1767317673 }
1767417674 }
17675- const req = info .httpModule.request(info .options, (msg) => {
17675+ const req = info2 .httpModule.request(info2 .options, (msg) => {
1767617676 const res = new HttpClientResponse(msg);
1767717677 handleResult(void 0, res);
1767817678 });
@@ -17684,7 +17684,7 @@ var require_lib = __commonJS({
1768417684 if (socket) {
1768517685 socket.end();
1768617686 }
17687- handleResult(new Error(`Request timeout: ${info .options.path}`));
17687+ handleResult(new Error(`Request timeout: ${info2 .options.path}`));
1768817688 });
1768917689 req.on("error", function(err) {
1769017690 handleResult(err);
@@ -17720,27 +17720,27 @@ var require_lib = __commonJS({
1772017720 return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
1772117721 }
1772217722 _prepareRequest(method, requestUrl, headers) {
17723- const info = {};
17724- info .parsedUrl = requestUrl;
17725- const usingSsl = info .parsedUrl.protocol === "https:";
17726- info .httpModule = usingSsl ? https : http;
17723+ const info2 = {};
17724+ info2 .parsedUrl = requestUrl;
17725+ const usingSsl = info2 .parsedUrl.protocol === "https:";
17726+ info2 .httpModule = usingSsl ? https : http;
1772717727 const defaultPort = usingSsl ? 443 : 80;
17728- info .options = {};
17729- info .options.host = info .parsedUrl.hostname;
17730- info .options.port = info .parsedUrl.port ? parseInt(info .parsedUrl.port) : defaultPort;
17731- info .options.path = (info .parsedUrl.pathname || "") + (info .parsedUrl.search || "");
17732- info .options.method = method;
17733- info .options.headers = this._mergeHeaders(headers);
17728+ info2 .options = {};
17729+ info2 .options.host = info2 .parsedUrl.hostname;
17730+ info2 .options.port = info2 .parsedUrl.port ? parseInt(info2 .parsedUrl.port) : defaultPort;
17731+ info2 .options.path = (info2 .parsedUrl.pathname || "") + (info2 .parsedUrl.search || "");
17732+ info2 .options.method = method;
17733+ info2 .options.headers = this._mergeHeaders(headers);
1773417734 if (this.userAgent != null) {
17735- info .options.headers["user-agent"] = this.userAgent;
17735+ info2 .options.headers["user-agent"] = this.userAgent;
1773617736 }
17737- info .options.agent = this._getAgent(info .parsedUrl);
17737+ info2 .options.agent = this._getAgent(info2 .parsedUrl);
1773817738 if (this.handlers) {
1773917739 for (const handler of this.handlers) {
17740- handler.prepareRequest(info .options);
17740+ handler.prepareRequest(info2 .options);
1774117741 }
1774217742 }
17743- return info ;
17743+ return info2 ;
1774417744 }
1774517745 _mergeHeaders(headers) {
1774617746 if (this.requestOptions && this.requestOptions.headers) {
@@ -19722,18 +19722,18 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
1972219722 (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
1972319723 }
1972419724 exports2.error = error;
19725- function warning (message, properties = {}) {
19725+ function warning2 (message, properties = {}) {
1972619726 (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
1972719727 }
19728- exports2.warning = warning ;
19728+ exports2.warning = warning2 ;
1972919729 function notice(message, properties = {}) {
1973019730 (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
1973119731 }
1973219732 exports2.notice = notice;
19733- function info (message) {
19733+ function info2 (message) {
1973419734 process.stdout.write(message + os.EOL);
1973519735 }
19736- exports2.info = info ;
19736+ exports2.info = info2 ;
1973719737 function startGroup(name) {
1973819738 (0, command_1.issue)("group", name);
1973919739 }
@@ -19854,6 +19854,7 @@ function parseInputs() {
1985419854 if (agentVersion) {
1985519855 validateAgentVersion(agentVersion);
1985619856 }
19857+ const apiToken = core.getInput("api-token");
1985719858 return {
1985819859 allowedDomains,
1985919860 allowedIps,
@@ -19864,7 +19865,9 @@ function parseInputs() {
1986419865 localAgent,
1986519866 logDirectory: core.getInput("_log-directory", { required: true }),
1986619867 agentDownloadBaseURL: core.getInput("_agent-download-base-url"),
19867- agentVersion: agentVersion || void 0
19868+ agentVersion: agentVersion || void 0,
19869+ controlPlaneBaseUrl: core.getInput("_control-plane-base-url"),
19870+ apiToken: apiToken || void 0
1986819871 };
1986919872}
1987019873
@@ -20019,11 +20022,27 @@ async function main() {
2001920022 collectProcessInfo,
2002020023 localAgent,
2002120024 logDirectory,
20022- agentVersion
20025+ agentVersion,
20026+ apiToken,
20027+ controlPlaneBaseUrl
2002320028 } = parseInputs();
2002420029 const actionDirectory = import_node_path.default.join(__dirname, "..");
2002520030 const agentDirectory = import_node_path.default.join(actionDirectory, "..", "agent");
2002620031 const pkg = require(`${actionDirectory}/../package.json`);
20032+ if (apiToken) {
20033+ try {
20034+ const url = new URL(controlPlaneBaseUrl);
20035+ const controlPlaneDomain = url.hostname;
20036+ allowedDomains.push(controlPlaneDomain);
20037+ core3.info(
20038+ `Added control plane domain to allowed domains: ${controlPlaneDomain}`
20039+ );
20040+ } catch (error) {
20041+ core3.warning(
20042+ `Failed to parse control plane URL: ${error instanceof Error ? error.message : String(error)}. Connection results will not be published to Bullfrog's control plane.`
20043+ );
20044+ }
20045+ }
2002720046 await import_promises3.default.mkdir(logDirectory, { recursive: true });
2002820047 const agentLogFilepath = import_node_path.default.join(logDirectory, AGENT_LOG_FILENAME);
2002920048 installPackages();
0 commit comments