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

Commit

Permalink
do not override existing Cargo.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-babichenko committed May 6, 2021
1 parent 35b7b53 commit d806ad5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -18,7 +19,9 @@ async function getData(): Promise<interfaces.Report> {
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 {
Expand Down

0 comments on commit d806ad5

Please sign in to comment.