Skip to content

Commit

Permalink
Flatten includes and verbosity into optional flags
Browse files Browse the repository at this point in the history
Flatten to options for the flexibility and avoiding parsing complexity
  • Loading branch information
ain committed Dec 9, 2023
1 parent 11bc0ed commit 374d00a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 28 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,21 @@ jobs:
uses: ./
with:
subcommand: lint
verbosity: normal
options: -v
target: test/vcl/valid.vcl

- name: Run Falco on valid VCL with high verbosity
uses: ./
with:
subcommand: lint
verbosity: high
options: -vv
target: test/vcl/valid.vcl

- name: Run Falco on valid VCL with include, normal velocity
- name: Run Falco on valid VCL with include, normal verbosity
uses: ./
with:
subcommand: lint
verbosity: normal
include: test/vcl/blocked_urls.vcl
options: "-v -I test/vcl/includes"
target: test/vcl/valid_with_include.vcl

#- name: Run Falco on invalid VCL
Expand Down
10 changes: 3 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ inputs:
target:
description: 'File path to VCL'
required: true
verbosity:
description: 'Verbosity'
required: false
include:
description: 'Include path'
options:
description: 'Optional flags'
required: false
outputs:
time: # id of output
Expand All @@ -22,6 +19,5 @@ runs:
image: 'Dockerfile'
args:
- ${{ inputs.subcommand }}
- ${{ inputs.include }}
- ${{ inputs.verbosity }}
- ${{ inputs.options }}
- ${{ inputs.target }}
17 changes: 1 addition & 16 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@

set -e

include=""
if [ -n $2 ]
then
include="-I ${2}"
fi

verbosity=""
if [[ $3 == "normal" ]]
then
verbosity="-v"
elif [[ $3 == "high" ]]
then
verbosity="-vv"
fi

falco $1 $include $verbosity $4
falco $1 $2 $3 $4
File renamed without changes.

0 comments on commit 374d00a

Please sign in to comment.