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

Commit a4d1867

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

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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 (!fs.existsSync('Cargo.lock')) {
23+
await cargo.call(['generate-lockfile']);
24+
}
2225

2326
let stdout = '';
2427
try {

0 commit comments

Comments
 (0)