Skip to content

Commit

Permalink
updated action, validation, readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
udit-uniyal committed Feb 19, 2024
1 parent dbd3f0c commit 0b4fe8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ inputs:
Steps for using Install-action in a workflow yaml file
- Checkout into the repo using checkout action.
- Utilize the accuknox/container-scan-action repository with version tag v1.
- Utilize the accuknox/container-scan-action repository with version tag v0.0.1.
### Token Generation from Accuknox SaaS and Viewing Tenant ID
Expand All @@ -64,7 +64,7 @@ Click on Generate:
```yaml
- name: Run AccuKnox CSPM Scan
uses: accuknox/container-scan-action@v1
uses: accuknox/container-scan-action@v0.0.1
with:
token:
tenant_id:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
uses: actions/checkout@main

- name: Run AccuKnox CSPM Scan
uses: accuknox/container-scan-action@v1
uses: accuknox/container-scan-action@v0.0.1
with:
token:
tenant_id:
Expand Down
4 changes: 3 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ runs:
using: 'composite'
steps:
- name: Validate Inputs
run: python ./validate_inputs.py
run: |
curl -o validate_inputs.py https://raw.githubusercontent.com/accuknox/container-scan-action/main/validate_inputs.py
python validate_inputs.py
shell: bash
env:
DOCKERFILE_CONTEXT: ${{ inputs.dockerfile_context }}
Expand Down
12 changes: 0 additions & 12 deletions validate_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ def validate_inputs(inputs):

if 'REPOSITORY_NAME' not in inputs or not inputs['REPOSITORY_NAME']:
errors.append("Repository name is required.")
if 'SEVERITY' in inputs:
valid_severities = {'UNKNOWN', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL'}
severity = inputs['SEVERITY'].upper()
if severity not in valid_severities:
errors.append("Invalid severity level provided.")


if 'CODE' in inputs:
code = inputs['CODE']
if code not in {'0', '1'}:
errors.append("Invalid code value provided.")
return errors

def main():
inputs = {
Expand Down

0 comments on commit 0b4fe8d

Please sign in to comment.