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

feat: add inputs.options #1

Merged
merged 1 commit into from
Apr 2, 2021
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 @@ -8,6 +8,7 @@ A GitHub Action for scanning a host with [testssl.sh](https://testssl.sh) and co
- `image`: Docker image to run testssl.sh (Default: `drwetter/testssl.sh`)
- `output`: Folder for scan reports (Default: `output`)
- `grade`: Minimum accepted grade (Default: `A+`)
- `options`: Additionnal testssl.sh CLI options

## Outputs

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
grade:
description: 'Minimum accepted grade'
default: 'A+'
options:
description: 'Additionnal testssl.sh CLI options'
default: ''
runs:
using: 'node12'
main: 'dist/index.js'
5 changes: 3 additions & 2 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ async function run() {
let image = core.getInput('image');
let host = core.getInput('host');
let output = core.getInput('output');
let options = core.getInput('options');
let thresshold = Grades[core.getInput('grade')];

await exec.exec(`mkdir -p ${workspace}/${output}`);
await exec.exec(`docker pull ${image} -q`);
let command = (`docker run --user 0:0 -v ${workspace}/${output}:/data --network="host" ` + `-t ${image} --jsonfile /data --csvfile /data --htmlfile /data ${host}`);
await exec.exec(`docker pull ${image} -q`);
let command = (`docker run --user 0:0 -v ${workspace}/${output}:/data --network="host" ` + `-t ${image} --jsonfile /data --csvfile /data --htmlfile /data ${options} ${host}`);
try {
await exec.exec(command);

Expand Down