Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit d806ad5

Browse files
do not override existing Cargo.lock
1 parent 35b7b53 commit d806ad5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as process from 'process';
22
import * as os from 'os';
3+
import * as fs from 'fs';
34

45
import * as core from '@actions/core';
56
import * as github from '@actions/github';
@@ -18,7 +19,9 @@ async function getData(): Promise<interfaces.Report> {
1819
const cargo = await Cargo.get();
1920
await cargo.findOrInstall('cargo-audit');
2021

21-
await cargo.call(['generate-lockfile']);
22+
if (!(await fs.exists('Cargo.lock'))) {
23+
await cargo.call(['generate-lockfile']);
24+
}
2225

2326
let stdout = '';
2427
try {

0 commit comments

Comments
 (0)