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

do not override existing Cargo.lock #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use the async call (stat?) for extra nicety. Not sure if this will make any difference, though.

await cargo.call(['generate-lockfile']);
}

let stdout = '';
try {
Expand Down