Repository navigation
Conversation
The infracost composite installs a checksum-verified binary and runs one of three modes over per-stack plan JSON: breakdown prices one ref to a JSON file, diff prices the other ref against it and applies the gate from gate.py, and comment renders the diff as a GitHub comment with the gate line appended and keeps one updating PR comment. mkconfig.sh turns a stack list into the Infracost config file; plan.sh runs tofu init, plan and show -json for every stack of one checkout. cost-diff-tofu.yml checks out base and head, assumes the read-only plan role, lists changed stacks with Terramate (or takes the directory input), plans both refs, prices them, comments and uploads the JSON and plans. The plan role is documented; update checks and Infracost Cloud uploads are off. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
Dependency ReviewThe following issues were found:
License Issues.github/workflows/cost-diff-tofu.yml
OpenSSF Scorecard
Scanned Files
|
tofu show -json includes sensitive planned values, so only the Infracost output leaves the runner. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
The action is run in CI and never redistributed; the existing setup composite already uses it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #89. Stacked on #170 (
issue-91-cost-gate) forgate.pyand the docs; retarget tomainonce that merges.What
.github/actions/infracost: Infracost0.10.46tarball verified against the published.sha256;modeinput.breakdown: config file from the stack list (mkconfig.sh: one project per<stack>/plan.json,usage_filewhen present, stacks without a plan skipped with a notice) theninfracost breakdown --config-file --format json.diff: same with--compare-to <base json>, thengate.pywith the thresholds, writing the gate snippet.comment:infracost output --format github-commentplus the snippet, posted as one comment found by the<!-- infracost -->marker and edited in place (fork PRs skipped by the workflow).INFRACOST_SKIP_UPDATE_CHECKandINFRACOST_ENABLE_CLOUD=falseset. Outputsmonthly-diff,monthly-total,percent-change,gate.plan.sh:tofu init -input=false,tofu plan -lock=false -out,tofu show -jsonper listed stack of one checkout; a stack missing from the base checkout is treated as new; the binary plan is deleted after the JSON is written.cost-diff-tofu.yml: inputs from the issue plustofu-version,terramate-version,actions-ref; secretINFRACOST_API_KEY. Head checkout with full history, base checkout into.cost-base,aws-oidc-auth,opentofu/setup-opentofuandterramate-io/terramate-actionat the pins the existing setup composite uses,terramate list --changed --git-change-base <base sha>or thedirectoryinput, plan both refs, breakdown, diff, comment, artefactinfracost(both JSONs, gate snippet, plans). No changed stacks ends the job with a notice. Caller grantsid-token: write,contents: read,pull-requests: write.ReadOnlyAccess) indocs/oidc-trust-policies.md;infracostrow indocs/approved-actions.md; README rows and "Cost Diff (Infracost)" section with the egress hosts. Thedocs/egress-allowlist.mdrow waits for feat(#83): harden-runner block mode with per-job egress allowlists #139 like the other stacks.Cost Gatejob now also runs the config-writer tests and the composite's checksum-verified install (comment mode with an empty PR number, which exits after the install).Tests
tests/infracost/run.shgainsmkconfig.shcases: two stacks with plans and a usage file (exact YAML), a stack without a plan skipped with a notice and nousage_filewhen empty, and no plans at all exiting 1. The gate cases from #170 unchanged.Deferred
INFRACOST_API_KEYorg secret exist (admin items).plan.shis exercised only there; it has no local test because it needs a backend.🤖 Generated with Claude Code
https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF