Hello all, newbie here. When i run `infracost brea...
# help
d
Hello all, newbie here. When i run
infracost breakdown --path=. --usage-file=../infracost-usage.yml --show-skipped
i get a table of costs with usage, all good. When i output as json and then publish to an ADO PR using `infracost comment`the baseline costs are not uploaded to the PR. Now i know this is not quite the norm - i understand that a PR should be showing the differences between the main branch and the PR branch, but when there are no changes to terraform in a PR, id like to show the baseline costs of the master branch, rather than no costs from the diff. Does that make sense? Is it possible? I am using the cli via cicd, at present there are no plans to move to the infracost cloud offering. Note - when i publish a PR with actual TF changes, it shows the usage, so i know my call to `infracost comment`does work.
b
Hello! Unfortunately, there is no such built-in functionality. The PR comment focuses on diffs only.
You could do this manually though in your CI workflow: 1. Run breakdown with JSON format 2. Use
jq
to extract the values 3. Make an API request to ADO to post a PR comment with these values.
d
😞 and 🙂 . Thank you for your prompt reply, i will give that a go 👍
b
You're welcome, good luck 🙂