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 7, 2021
1 parent 35b7b53 commit a4d1867
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

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

let stdout = '';
try {
Expand Down

0 comments on commit a4d1867

Please sign in to comment.