Skip to content

Commit

Permalink
Merge pull request #21 from ksoclabs/print-results-to-stdout
Browse files Browse the repository at this point in the history
Print results to stdout by default
  • Loading branch information
pawelkowalak authored May 10, 2023
2 parents e27a1ee + 706b371 commit e61edd3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM us.gcr.io/ksoc-public/policy-executor:v0.0.11
FROM us.gcr.io/ksoc-public/policy-executor:v0.0.12

COPY entrypoint.sh /entrypoint.sh

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: KSOC Guard
uses: ksoclabs/[email protected].9
uses: ksoclabs/[email protected].10
with:
ksoc_account_id: <KSOC_ACCOUNT_ID>
ksoc_access_key_id: ${{ secrets.KSOC_ACCESS_KEY_ID }}
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: KSOC Guard
uses: ksoclabs/[email protected].9
uses: ksoclabs/[email protected].10
with:
policy_dir: /policies
```
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
uses: actions/checkout@v3
- name: KSOC Guard
id: ksoc-guard
uses: ksoclabs/[email protected].9
uses: ksoclabs/[email protected].10
with:
ksoc_account_id: <KSOC_ACCOUNT_ID>
ksoc_access_key_id: ${{ secrets.KSOC_ACCESS_KEY_ID }}
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
uses: actions/checkout@v3
- name: KSOC Guard
id: ksoc-guard
uses: ksoclabs/[email protected].9
uses: ksoclabs/[email protected].10
with:
fail_on_severity: low
format: sarif
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
fail_on_severity:
required: false
description: "The severity level at which to fail the workflow. Valid values are: none, low, medium, high, critical."
default: high
default: none
format:
required: false
description: "The format of the output. Valid values are: ci-table, table."
Expand Down
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh -l

EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
if [ $FORMAT = "sarif" ]; then
SARIF_OUTPUT_FILE_NAME="./report.sarif"
/app/policy-executor policies execute > $SARIF_OUTPUT_FILE_NAME
exit_code=$?
echo "sarif=$SARIF_OUTPUT_FILE_NAME" >> $GITHUB_OUTPUT
else
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "results<<$EOF" >> $GITHUB_OUTPUT
/app/policy-executor policies execute >> $GITHUB_OUTPUT
exit_code=$?
echo "$EOF" >> $GITHUB_OUTPUT
grep -v "$EOF" $GITHUB_OUTPUT
fi
exit $exit_code

0 comments on commit e61edd3

Please sign in to comment.