Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Zantow <kzantow@gmail.com>
  • Loading branch information
kzantow committed Mar 16, 2022
1 parent c841ab4 commit 4948754
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
8 changes: 7 additions & 1 deletion dist/attachReleaseAssets/index.js

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

8 changes: 7 additions & 1 deletion dist/downloadSyft/index.js

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

8 changes: 7 additions & 1 deletion dist/runSyftAction/index.js

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

13 changes: 9 additions & 4 deletions src/github/SyftGithubAction.ts
Expand Up @@ -308,6 +308,10 @@ async function comparePullRequestTargetArtifact(): Promise<void> {
}
}

function uploadToSnapshotAPI() {
return getBooleanInput("dependency-snapshot", false);
}

export async function runSyftAction(): Promise<void> {
core.info(dashWrap("Running SBOM Action"));

Expand All @@ -323,10 +327,7 @@ export async function runSyftAction(): Promise<void> {
image: core.getInput("image"),
},
format: getSbomFormat(),
uploadToDependencySnapshotAPI: getBooleanInput(
"dependency-snapshot",
false
),
uploadToDependencySnapshotAPI: uploadToSnapshotAPI(),
});

core.info(`SBOM scan completed in: ${(Date.now() - start) / 1000}s`);
Expand Down Expand Up @@ -355,6 +356,10 @@ export async function runSyftAction(): Promise<void> {
* Attaches the SBOM assets to a release if run in release mode
*/
export async function uploadDependencySnapshot(): Promise<void> {
if (!uploadToSnapshotAPI()) {
return;
}

if (!fs.existsSync(githubDependencySnapshotFile)) {
core.warning(
`No dependency snapshot found at '${githubDependencySnapshotFile}'`
Expand Down

0 comments on commit 4948754

Please sign in to comment.