From b20f2f5048ac2686f37dbe569c32e5f2263ecb05 Mon Sep 17 00:00:00 2001 From: Priyagupta108 Date: Thu, 27 Feb 2025 15:36:19 +0530 Subject: [PATCH] Update isSelfHosted logic --- dist/setup/index.js | 12 ++++++------ src/utils.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 432128d..945743b 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -96642,15 +96642,15 @@ var StableReleaseAlias; StableReleaseAlias["Stable"] = "stable"; StableReleaseAlias["OldStable"] = "oldstable"; })(StableReleaseAlias || (exports.StableReleaseAlias = StableReleaseAlias = {})); -const isSelfHosted = () => process.env['AGENT_ISSELFHOSTED'] === '1' || - (process.env['AGENT_ISSELFHOSTED'] === undefined && - process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted'); +const isSelfHosted = () => process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && + (process.env['AGENT_ISSELFHOSTED'] === '1' || + process.env['AGENT_ISSELFHOSTED'] === undefined); exports.isSelfHosted = isSelfHosted; /* the above is simplified from: - process.env['RUNNER_ENVIRONMENT'] === undefined && process.env['AGENT_ISSELFHOSTED'] === '1' + process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && process.env['AGENT_ISSELFHOSTED'] === '1' || - process.env['AGENT_ISSELFHOSTED'] === undefined && process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' - */ + process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && process.env['AGENT_ISSELFHOSTED'] === undefined +*/ /***/ }), diff --git a/src/utils.ts b/src/utils.ts index a5301be..19f5296 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -4,11 +4,11 @@ export enum StableReleaseAlias { } export const isSelfHosted = (): boolean => - process.env['AGENT_ISSELFHOSTED'] === '1' || - (process.env['AGENT_ISSELFHOSTED'] === undefined && - process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted'); + process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && + (process.env['AGENT_ISSELFHOSTED'] === '1' || + process.env['AGENT_ISSELFHOSTED'] === undefined); /* the above is simplified from: - process.env['RUNNER_ENVIRONMENT'] === undefined && process.env['AGENT_ISSELFHOSTED'] === '1' + process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && process.env['AGENT_ISSELFHOSTED'] === '1' || - process.env['AGENT_ISSELFHOSTED'] === undefined && process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' - */ + process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && process.env['AGENT_ISSELFHOSTED'] === undefined +*/