See the .github/workflows/badges.yml file for the example.
This repo shows an example of how Infracost can be used alongside https://github.com/Schneegans/dynamic-badges-action/ to create a readme badge for Terraform module repos. In the future, Infracost Cloud will have GitHub App integration that will automatically build the main branch of a repo. That could enable a pre-authenticated link to be created from the repo and link to from the badge. That would mean a readme badge could be added without using 3rd party GitHub Actions and enable users to see detailed breakdown of the cost estimate.