Detected whether we're running in a Namespace runner, and if so, set init: none. (#52)

Background: Namespace managed runners run each github job in a container, in a
separate micro-vm managed by Namespace. These VMs and containers do not rely on
systemd, and instead use Namespace's own init/process management.
This commit is contained in:
Hugo Santos 2023-11-02 16:58:37 +01:00 committed by GitHub
parent 721f94f7df
commit 7fa8f59903
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

4
dist/index.js vendored
View file

@ -189,6 +189,10 @@ class NixInstallerAction {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info("Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`");
execution_env.NIX_INSTALLER_INIT = "none";
}
if (process.env.NSC_VM_ID && !process.env.NOT_NAMESPACE) {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info("Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace");
execution_env.NIX_INSTALLER_INIT = "none";
}
return execution_env;
}
async execute_install(binary_path) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -239,6 +239,13 @@ class NixInstallerAction {
execution_env.NIX_INSTALLER_INIT = "none";
}
if (process.env.NSC_VM_ID && !process.env.NOT_NAMESPACE) {
actions_core.info(
"Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace",
);
execution_env.NIX_INSTALLER_INIT = "none";
}
return execution_env;
}