Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure of terrascan hook to use config file #492

Open
snemetz opened this issue Feb 9, 2023 · 1 comment
Open

Failure of terrascan hook to use config file #492

snemetz opened this issue Feb 9, 2023 · 1 comment
Labels
estimate/1h Need 1 hour to be done feature New feature or request good first issue Good for newcomers hook/terrascan Bash hook

Comments

@snemetz
Copy link

snemetz commented Feb 9, 2023

Describe the bug

Need to have terrascan use a config file.

Tried to use

  • id: terrascan
    args:
    • --args="-c .terrascan.toml"

Got error

2023-02-08T19:52:39.243-0800 error config/config-reader.go:62 config file: .terrascan.toml, doesn't exist
2023-02-08T19:52:39.244-0800 error cli/register.go:71 error while loading global config{error 26 0 config file not present}

Also, tried adding GIT_WORKING_DIR/ but that doesn't seem to be supported in this hook.
Would be good if GIT_WORKING_DIR was supported in all hooks

No idea what directory terrascan is run from. But it is not the top of the git repo.

How can we reproduce it?

Create .terrascan.toml in the root of the git repo
Add below to .pre-commit-config.yaml

repos:

Execute pre-commit

Environment information

  • OS: macOS 13.2

  • Tools availability and versions:

terrascan version: v1.18.0
@snemetz snemetz added area/local_installation bug Something isn't working labels Feb 9, 2023
@MaxymVlasov MaxymVlasov added feature New feature or request good first issue Good for newcomers estimate/1h Need 1 hour to be done hook/terrascan Bash hook and removed bug Something isn't working area/local_installation labels Feb 9, 2023
@MaxymVlasov
Copy link
Collaborator

Hi
It could be simply done by adding __GIT_WORKING_DIR__ support

Here is example

#399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimate/1h Need 1 hour to be done feature New feature or request good first issue Good for newcomers hook/terrascan Bash hook
Projects
None yet
Development

No branches or pull requests

2 participants