Skip to content

Commit

Permalink
Add entrypoint logic for options
Browse files Browse the repository at this point in the history
  • Loading branch information
ain committed Dec 9, 2023
1 parent 4b923ba commit 72ee105
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:
subcommand: lint
target: test/acl/valid.acl

- name: Run Falco on valid ACL with verbosity
- name: Run Falco on valid ACL with normal verbosity
uses: ./
with:
subcommand: lint
verbosity: -v
verbosity: normal
target: test/acl/valid.acl

- name: Run Falco on valid ACL with most verbosity
- name: Run Falco on valid ACL with high verbosity
uses: ./
with:
subcommand: lint
verbosity: -vv
verbosity: high
target: test/acl/valid.acl

#- name: Run Falco on ACL with invalid IP
Expand Down Expand Up @@ -64,25 +64,25 @@ jobs:
subcommand: lint
target: test/vcl/valid.vcl

- name: Run Falco on valid VCL with verbosity
- name: Run Falco on valid VCL with normal verbosity
uses: ./
with:
subcommand: lint
verbosity: -v
verbosity: normal
target: test/vcl/valid.vcl

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

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

Expand Down
16 changes: 15 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@

set -e

falco $1 $2 $3 $4
include=""
if [ -n $2 ]
then
include="-I ${$2}"
fi

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

falco $1 $include $verbosity $4

0 comments on commit 72ee105

Please sign in to comment.