Skip to content

Commit

Permalink
feat: add apiUrl to action [MFST-4249]
Browse files Browse the repository at this point in the history
  • Loading branch information
manifestori committed Nov 6, 2024
1 parent 7424dee commit 94c9b6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
branches:
- "main"
- "feat-api-uri"

permissions:
id-token: write
Expand All @@ -22,8 +23,9 @@ jobs:
uses: actions/checkout@v4

- name: generate SBOM
uses: manifest-cyber/manifest-github-action@main
uses: manifest-cyber/manifest-github-action@feat-api-uri
with:
apiKey: ${{ secrets.MANIFEST_API_KEY }}
asset-labels: "github-action, production"
generator: "syft"
apiUri: "https://api.manifest.cyber"
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ inputs:
description: "set the SBOM as active. Expects either `true` or `false`."
required: false

apiUri:
description: "set the Manifest API endpoint URI."
required: false

runs:
using: "node20"
main: "index.js"
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ async function generateSBOM(
}

if (generator === "syft" && generatorVersion === "") {
generatorVersion = "v1.11.1";
generatorVersion = "v1.16.0";
}

if (generator === "trivy" && generatorVersion === "") {
generatorVersion = "v0.54.1";
generatorVersion = "v0.57.0";
}

const installCommand =
Expand Down Expand Up @@ -239,6 +239,7 @@ try {
core.getInput("bomLabels") ||
core.getInput("asset-labels") ||
"";
const apiURI = core.getInput("apiURI");
const productLabels = core.getInput("product-labels") || "";
const productId = core.getInput("product-id") || "";

Expand Down Expand Up @@ -312,6 +313,9 @@ try {
`publish`,
`--ignore-validation="true"`,
];
if (apiURI) {
publishCommandParts.push(`--api-uri="${apiURI}"`);
}
if (source) {
publishCommandParts.push(`--source="${source}"`);
}
Expand Down

0 comments on commit 94c9b6d

Please sign in to comment.