Fix direction of Boolean check

This commit is contained in:
Luc Perkins 2024-05-29 16:07:07 -03:00
parent ad8814ae5d
commit 8ef3f8c93e
No known key found for this signature in database
GPG key ID: 16DB1108FB591835
3 changed files with 13 additions and 12 deletions

View file

@ -19,6 +19,7 @@ inputs:
default: false default: false
force-docker-shim: force-docker-shim:
description: Force the use of Docker as a process supervisor. This setting is automatically enabled when necessary. description: Force the use of Docker as a process supervisor. This setting is automatically enabled when necessary.
required: false
default: false default: false
github-token: github-token:
description: A GitHub token for making authenticated requests (which have a higher rate-limit quota than unauthenticated requests) description: A GitHub token for making authenticated requests (which have a higher rate-limit quota than unauthenticated requests)

12
dist/index.js generated vendored
View file

@ -97864,14 +97864,14 @@ var NixInstallerAction = class extends DetSysAction {
get isLinux() { get isLinux() {
return this.runnerOs === "Linux"; return this.runnerOs === "Linux";
} }
get runningInAct() { get isRunningInAct() {
return process.env["ACT"] !== void 0 && !(process.env["NOT_ACT"] === ""); return process.env["ACT"] !== void 0 && !(process.env["NOT_ACT"] === "");
} }
get runningInNamespaceRunner() { get isRunningInNamespaceRunner() {
return process.env["NSC_VM_ID"] !== void 0 && !(process.env["NOT_NAMESPACE"] === "true"); return process.env["NSC_VM_ID"] !== void 0 && !(process.env["NOT_NAMESPACE"] === "true");
} }
async detectAndForceDockerShim() { async detectAndForceDockerShim() {
if (this.isLinux) { if (!this.isLinux) {
if (this.forceDockerShim) { if (this.forceDockerShim) {
core.warning( core.warning(
"Ignoring force-docker-shim which is set to true, as it is only supported on Linux." "Ignoring force-docker-shim which is set to true, as it is only supported on Linux."
@ -97880,7 +97880,7 @@ var NixInstallerAction = class extends DetSysAction {
} }
return; return;
} }
if (this.runningInAct) { if (this.isRunningInAct) {
core.debug( core.debug(
"Not bothering to detect if the docker shim should be used, as it is typically incompatible with act." "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act."
); );
@ -98161,14 +98161,14 @@ ${stderrBuffer}`
extraConf += "\n"; extraConf += "\n";
} }
executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf;
if (this.runningInAct) { if (this.isRunningInAct) {
this.addFact(FACT_IN_ACT, true); this.addFact(FACT_IN_ACT, true);
core.info( core.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`" "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`"
); );
executionEnv.NIX_INSTALLER_INIT = "none"; executionEnv.NIX_INSTALLER_INIT = "none";
} }
if (this.runningInNamespaceRunner) { if (this.isRunningInNamespaceRunner) {
this.addFact(FACT_IN_NAMESPACE_SO, true); this.addFact(FACT_IN_NAMESPACE_SO, true);
core.info( 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" "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"

View file

@ -133,11 +133,11 @@ class NixInstallerAction extends DetSysAction {
return this.runnerOs === "Linux"; return this.runnerOs === "Linux";
} }
private get runningInAct(): boolean { private get isRunningInAct(): boolean {
return process.env["ACT"] !== undefined && !(process.env["NOT_ACT"] === ""); return process.env["ACT"] !== undefined && !(process.env["NOT_ACT"] === "");
} }
private get runningInNamespaceRunner(): boolean { private get isRunningInNamespaceRunner(): boolean {
return ( return (
process.env["NSC_VM_ID"] !== undefined && process.env["NSC_VM_ID"] !== undefined &&
!(process.env["NOT_NAMESPACE"] === "true") !(process.env["NOT_NAMESPACE"] === "true")
@ -148,7 +148,7 @@ class NixInstallerAction extends DetSysAction {
// Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker. // Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker.
// This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/), // This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/),
// and especially GitHub Enterprise Server. // and especially GitHub Enterprise Server.
if (this.isLinux) { if (!this.isLinux) {
if (this.forceDockerShim) { if (this.forceDockerShim) {
actionsCore.warning( actionsCore.warning(
"Ignoring force-docker-shim which is set to true, as it is only supported on Linux.", "Ignoring force-docker-shim which is set to true, as it is only supported on Linux.",
@ -158,7 +158,7 @@ class NixInstallerAction extends DetSysAction {
return; return;
} }
if (this.runningInAct) { if (this.isRunningInAct) {
actionsCore.debug( actionsCore.debug(
"Not bothering to detect if the docker shim should be used, as it is typically incompatible with act.", "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act.",
); );
@ -493,7 +493,7 @@ class NixInstallerAction extends DetSysAction {
} }
executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf;
if (this.runningInAct) { if (this.isRunningInAct) {
this.addFact(FACT_IN_ACT, true); this.addFact(FACT_IN_ACT, true);
actionsCore.info( actionsCore.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`", "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`",
@ -501,7 +501,7 @@ class NixInstallerAction extends DetSysAction {
executionEnv.NIX_INSTALLER_INIT = "none"; executionEnv.NIX_INSTALLER_INIT = "none";
} }
if (this.runningInNamespaceRunner) { if (this.isRunningInNamespaceRunner) {
this.addFact(FACT_IN_NAMESPACE_SO, true); this.addFact(FACT_IN_NAMESPACE_SO, true);
actionsCore.info( actionsCore.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", "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",