Skip to content

Commit

Permalink
Merge pull request #2 from chaitin/feat/exitcode
Browse files Browse the repository at this point in the history
feat: exit-code
  • Loading branch information
d1nfinite authored Apr 26, 2022
2 parents c979e56 + 648c5e6 commit e2712c9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
- uses: chaitin/veinmind-action@main
with:
scan-action: scan-host
image-ref: weakpass:latest
image-ref: weakpass:latest
exit-code: 1
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:

## 🏳️‍🌈 参数设置

| 参数名称 | 参数作用 | 默认值 |
| ----------- | -------------- | --------- |
| scan-action | 扫描功能类型 | scan-host |
| image-ref | 镜像 Reference | |

| 参数名称 | 参数作用 | 默认值 |
| ----------- | ---------------------------- | --------- |
| scan-action | 扫描功能类型 | scan-host |
| image-ref | 镜像 Reference | |
| exit-code | 当发现安全问题时的程序退出码 | 0 |
| output | 报告输出名称 | |
6 changes: 5 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ inputs:
image-ref:
description: 'image reference'
required: true
exit-code:
description: 'exit-code when specified security issue found'
required: false
default: '0'
output:
description: 'save results to output file'
required: false
default: 'report.json'
runs:
using: 'composite'
steps:
- run: mkdir data && bash run.sh ${{ inputs.scan-action }} ${{ inputs.image-ref }} -o /data/${{ inputs.output }}
- run: mkdir data && bash run.sh ${{ inputs.scan-action }} ${{ inputs.image-ref }} -o /data/${{ inputs.output }} -e ${{ inputs.exit-code }}
shell: bash
- uses: actions/upload-artifact@v2
with:
Expand Down

0 comments on commit e2712c9

Please sign in to comment.