Skip to content

Commit

Permalink
Fix direction of Boolean check
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed May 29, 2024
1 parent ad8814a commit 8ef3f8c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ inputs:
default: false
force-docker-shim:
description: Force the use of Docker as a process supervisor. This setting is automatically enabled when necessary.
required: false
default: false
github-token:
description: A GitHub token for making authenticated requests (which have a higher rate-limit quota than unauthenticated requests)
Expand Down
12 changes: 6 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ class NixInstallerAction extends DetSysAction {
return this.runnerOs === "Linux";
}

private get runningInAct(): boolean {
private get isRunningInAct(): boolean {
return process.env["ACT"] !== undefined && !(process.env["NOT_ACT"] === "");
}

private get runningInNamespaceRunner(): boolean {
private get isRunningInNamespaceRunner(): boolean {
return (
process.env["NSC_VM_ID"] !== undefined &&
!(process.env["NOT_NAMESPACE"] === "true")
Expand All @@ -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.
// This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/),
// and especially GitHub Enterprise Server.
if (this.isLinux) {
if (!this.isLinux) {
if (this.forceDockerShim) {
actionsCore.warning(
"Ignoring force-docker-shim which is set to true, as it is only supported on Linux.",
Expand All @@ -158,7 +158,7 @@ class NixInstallerAction extends DetSysAction {
return;
}

if (this.runningInAct) {
if (this.isRunningInAct) {
actionsCore.debug(
"Not bothering to detect if the docker shim should be used, as it is typically incompatible with act.",
);
Expand Down Expand Up @@ -493,15 +493,15 @@ class NixInstallerAction extends DetSysAction {
}
executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf;

if (this.runningInAct) {
if (this.isRunningInAct) {
this.addFact(FACT_IN_ACT, true);
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`",
);
executionEnv.NIX_INSTALLER_INIT = "none";
}

if (this.runningInNamespaceRunner) {
if (this.isRunningInNamespaceRunner) {
this.addFact(FACT_IN_NAMESPACE_SO, true);
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",
Expand Down

0 comments on commit 8ef3f8c

Please sign in to comment.