Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding argument for api-key usage #18

Merged
merged 1 commit into from
Dec 8, 2023
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ The inputs `image`, `path`, and `sbom` are mutually exclusive to specify the sou
| `registry-username` | The registry username to use when authenticating to an external registry | |
| `registry-password` | The registry password to use when authenticating to an external registry | |
| `fail-build` | Fail the build if an end-of-life (EOL) software is found | `true` |
| `api-key` | The API key to use to send results to xeol.io | N/A |
| `output-format` | Set the output parameter after successful action execution. Valid choices are `json`, and `table`, where `table` output will print to the console instead of generating a file. | `table` |


Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ async function run() {
// a check must happen to ensure one is selected at least, and then return it
const source = sourceInput();
const failBuild = core.getInput("fail-build") || "true";
const apiKey = core.getInput("api-key") || "";
const outputFormat = core.getInput("output-format") || "table";
const out = await runScan({
source,
failBuild,
apiKey,
outputFormat,
});
Object.keys(out).map((key) => {
Expand All @@ -104,6 +106,7 @@ async function run() {
async function runScan({
source,
failBuild,
apiKey,
outputFormat,
}) {
const out = {};
Expand Down Expand Up @@ -164,6 +167,9 @@ async function runScan({
if (failBuild) {
cmdArgs.push("--fail-on-eol-found");
}
if (apiKey) {
cmdArgs.push("--api-key", apiKey);
}
cmdArgs.push(source);

// This /dev/null writable stream is required so the entire Xeol output
Expand Down
Loading