Skip to content

Commit

Permalink
fix: ensure sbom is copied to output-file (#411)
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Salazar <[email protected]>
  • Loading branch information
gszr authored Apr 12, 2023
1 parent 800a56f commit 8e2e937
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions dist/attachReleaseAssets/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/downloadSyft/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/runSyftAction/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/github/SyftGithubAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { SyftOptions } from "../Syft";
import { VERSION } from "../SyftVersion";
import { execute } from "./Executor";
import {
DependencySnapshot,
dashWrap,
debugLog,
DependencySnapshot,
getClient,
} from "./GithubClient";
import { downloadSyftFromZip } from "./SyftDownloader";
Expand Down Expand Up @@ -282,11 +282,6 @@ export async function uploadSbomArtifact(contents: string): Promise<void> {

const retentionDays = parseInt(core.getInput("upload-artifact-retention"));

const outputFile = core.getInput("output-file");
if (outputFile) {
fs.copyFileSync(filePath, outputFile);
}

core.info(dashWrap("Uploading workflow artifacts"));
core.info(filePath);

Expand Down Expand Up @@ -384,6 +379,11 @@ export async function runSyftAction(): Promise<void> {
core.debug(`Prior artifact: ${priorArtifact}`);
}

const outputFile = core.getInput("output-file");
if (outputFile) {
fs.writeFileSync(outputFile, output);
}

if (doUpload) {
await uploadSbomArtifact(output);

Expand Down

0 comments on commit 8e2e937

Please sign in to comment.