Skip to content

Commit 2973f85

Browse files
feat: add __GIT_WORKING_DIR__ to tfsec (antonbabenko#255)
1 parent c0b9b3c commit 2973f85

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,14 @@ Example:
372372
--no-color
373373
-e aws-s3-enable-bucket-logging,aws-s3-specify-public-access-block
374374
```
375+
4. Like terraform_tflint, `__GIT_WORKING_DIR__` can be used when specifying files relative to the git working directory:
375376
377+
Example:
378+
379+
```yaml
380+
- id: terraform_tfsec
381+
args: [--args=--config-file=__GIT_WORKING_DIR__/.tfsec.json]
382+
```
376383
377384
### terraform_validate
378385

terraform_tfsec.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ parse_cmdline_() {
5454
case $argv in
5555
-a | --args)
5656
shift
57-
ARGS+=("$1")
57+
expanded_arg="${1//__GIT_WORKING_DIR__/$PWD}"
58+
ARGS+=("$expanded_arg")
5859
shift
5960
;;
6061
--)

0 commit comments

Comments
 (0)