diff --git a/package.json b/package.json index 66c18e1..f080b12 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@actions/core": "^1.11.1", "@actions/exec": "^1.1.1", + "@actions/io": "^1.1.3", "just-split": "^3.2.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bede4d5..e8ec7e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@actions/exec': specifier: ^1.1.1 version: 1.1.1 + '@actions/io': + specifier: ^1.1.3 + version: 1.1.3 just-split: specifier: ^3.2.0 version: 3.2.0 diff --git a/src/stages/install.ts b/src/stages/install.ts index defece1..481c113 100644 --- a/src/stages/install.ts +++ b/src/stages/install.ts @@ -1,5 +1,6 @@ import * as core from "@actions/core"; import { exec } from "@actions/exec"; +import { findInPath } from "@actions/io"; export const install = async () => { core.startGroup("Install attic"); @@ -16,6 +17,5 @@ export const install = async () => { }; export const isInstalled = async () => { - let returnCode = await exec("attic", ["-V"]); - return returnCode === 0; + return (await findInPath("attic")).length > 0; };