Explain why it was detected as self-hosted

This commit is contained in:
Benoit Daloze
2023-03-03 18:01:46 +01:00
parent d01c52ad8b
commit 5a73aa9f67
3 changed files with 29 additions and 4 deletions
+12
View File
@@ -179,6 +179,18 @@ export function isSelfHostedRunner() {
getRunnerToolCache() !== getDefaultToolCachePath()
}
export function selfHostedRunnerReason() {
if (inputs.selfHosted === 'true') {
return 'the self-hosted input was set'
} else if (!GitHubHostedPlatforms.includes(getOSNameVersionArch())) {
return 'the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported)'
} else if (getRunnerToolCache() !== getDefaultToolCachePath()) {
return 'the $RUNNER_TOOL_CACHE is different than the default tool cache path (they must be the same to reuse prebuilt Ruby binaries)'
} else {
return 'unknown reason'
}
}
let virtualEnvironmentName = undefined
export function getVirtualEnvironmentName() {