This message was deleted.
# general
b
This message was deleted.
m
Hey @dry-football-79311 , we have a terragrunt example in our actions repository here: https://github.com/infracost/actions/tree/master/examples/terragrunt
d
ah cool thx
🙌 1
i dont get this step
Copy code
- name: Run Infracost
        run: infracost breakdown --path=examples/terragrunt/code --format=json --out-file=/tmp/infracost.json
i though path was for plan.json ?
b
--path
can accept a directory too https://www.infracost.io/docs/features/cli_commands/#option-1-terraform-directory. This is a simplest way to start using Infracost 🙂
FYI If you have a non-trivial project structure with several directories, you can also create a config file specifying this details. Here's how to use it: https://www.infracost.io/docs/features/config_file/
d
hey is there this script https://www.infracost.io/docs/troubleshooting/#terragrunt in github action ?
b
Hey! Unfortunately no, but you could copy-paste it in a separate step
w
@dry-football-79311 I’m curious if Infracost Terragrunt logic didn’t work for your use-case? That’s used in the GH example that Hugo mentioned, and it’s similar to what the troubleshooting bash script does (the bash script creates a config-file dynamically, to run infracost, then deletes it). I tweaked the docs to clarify this.
d
Actually the action that Vadim mentioned worked fine in my terragrunt repo. I was just trying to check whats happening under the hood 🙂
🙌 1
I have another question. There isnt a infracost login command right ?
to reuse the same token ?
m
Sadly not at the moment, If you want to use the same token you used on a different machine e.t.c, you can pull it with:
Copy code
infracost configure get api_key
then set it with
Copy code
infracost configure set api_key ${token_from_before}
✔️ 1
d
cool thx
About the comment on github PR , it will run only once until it finds any difference , because i ran my pipeline twice and i only saw one comment ?
m
which post
--behaviour
are you running with
infracost comment
with? If it’s
update
this will only create one comment and update it with costs as they change. If you want a new comment every time you can use
new
✔️ 1
alternatively
hide-and-new
which hide previous matching comments and create a new comment or
delete-and-new
which deletes a previous matching comments and create a new comment
d
this is great thanks for the helpfull answers
m
no problem