Fix self-hosted environment check

This commit is contained in:
Priyagupta108 2025-02-25 16:01:26 +05:30
parent 5a083d0e9a
commit a5bc5249cb
7 changed files with 114 additions and 15 deletions

View file

@ -2,3 +2,13 @@ export enum StableReleaseAlias {
Stable = 'stable',
OldStable = 'oldstable'
}
export const isSelfHosted = (): boolean =>
process.env['AGENT_ISSELFHOSTED'] === '1' ||
(process.env['AGENT_ISSELFHOSTED'] === undefined &&
process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted');
/* the above is simplified from:
process.env['RUNNER_ENVIRONMENT'] === undefined && process.env['AGENT_ISSELFHOSTED'] === '1'
||
process.env['AGENT_ISSELFHOSTED'] === undefined && process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted'
*/