mirror of
https://github.com/stackrox/kube-linter-action.git
synced 2026-07-18 13:28:08 +00:00
Merge pull request #4 from stackrox/neilcar/add-output-file
Add output-file
This commit is contained in:
+10
-7
@@ -7,10 +7,10 @@ inputs:
|
|||||||
config:
|
config:
|
||||||
description: 'Path to config file'
|
description: 'Path to config file'
|
||||||
required: false
|
required: false
|
||||||
outputs:
|
output-file:
|
||||||
lint-txt:
|
description: 'Filename to store output. Default "kubelinter.log"'
|
||||||
description: 'Output from linting'
|
required: false
|
||||||
value: ${{ steps.lint.outputs.lint-txt }}
|
default: 'kubelinter.log'
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -22,14 +22,17 @@ runs:
|
|||||||
curl -s -L -o kube-linter-linux.tar.gz $LOCATION
|
curl -s -L -o kube-linter-linux.tar.gz $LOCATION
|
||||||
tar -xf kube-linter-linux.tar.gz -C "${GITHUB_WORKSPACE}/"
|
tar -xf kube-linter-linux.tar.gz -C "${GITHUB_WORKSPACE}/"
|
||||||
shell: bash
|
shell: bash
|
||||||
- id: lint
|
- name: Lint files
|
||||||
|
id: lint
|
||||||
run: |
|
run: |
|
||||||
|
set +e
|
||||||
cd "${GITHUB_WORKSPACE}"
|
cd "${GITHUB_WORKSPACE}"
|
||||||
if [ -z ${{ inputs.config }} ]; then
|
if [ -z ${{ inputs.config }} ]; then
|
||||||
export CONFIG=""
|
export CONFIG=""
|
||||||
else
|
else
|
||||||
export CONFIG="--config ${{ inputs.config }}"
|
export CONFIG="--config ${{ inputs.config }}"
|
||||||
fi
|
fi
|
||||||
./kube-linter $CONFIG lint ${{ inputs.directory }}
|
./kube-linter $CONFIG lint ${{ inputs.directory }} 2>&1 | tee ${{ inputs.output-file }}
|
||||||
|
result_code=${PIPESTATUS[0]}
|
||||||
|
exit $result_code
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user