Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
packages = with pkgs; [
nodejs_latest
nixpkgs-fmt
nodePackages_latest.typescript-language-server
];
};
});
Expand Down
27 changes: 26 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,35 @@ class NixInstallerAction {
}
async cleanupDockerShim(): Promise<void> {
const container_id = actions_core.getState("docker_shim_container_id");

if (container_id !== "") {
actions_core.startGroup("Cleaning up the Nix daemon's Docker shim");

await actions_exec.exec("docker", ["rm", "--force", container_id]);
let cleaned = false;
try {
await actions_exec.exec("docker", ["rm", "--force", container_id]);
cleaned = true;
} catch {
actions_core.warning("failed to cleanup nix daemon container");
}

if (!cleaned) {
actions_core.info("trying to pkill the container's shim process");
try {
await actions_exec.exec("pkill", [container_id]);
cleaned = true;
} catch {
actions_core.warning(
"failed to forcibly kill the container's shim process",
);
}
}

if (!cleaned) {
actions_core.warning(
"Giving up on cleaning up the nix daemon container",
);
}

actions_core.endGroup();
}
Expand Down