diff --git a/src/main.ts b/src/main.ts index 220486e..72fbb6e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,6 @@ import * as process from 'process'; import * as os from 'os'; +import * as fs from 'fs'; import * as core from '@actions/core'; import * as github from '@actions/github'; @@ -18,7 +19,9 @@ async function getData(): Promise { const cargo = await Cargo.get(); await cargo.findOrInstall('cargo-audit'); - await cargo.call(['generate-lockfile']); + if (!(await fs.exists('Cargo.lock'))) { + await cargo.call(['generate-lockfile']); + } let stdout = ''; try {