This GitHub Action downloads and installs the Infracost CLI in your GitHub Actions workflow. Subsequent steps in the same job can run the CLI in the same way it is run on the command line using the GitHub Actions run
syntax.
The action can be used as follows. You probably want to run Infracost CLI commands then use the comment action to post comments! See the top-level readme for examples of how these actions can be combined.
steps:
- name: Setup Infracost
uses: infracost/actions/setup@v1
with:
api-key: ${{ secrets.INFRACOST_API_KEY }}
The action supports the following inputs:
-
api-key
: Required. Your Infracost API key. It can be retrieved by runninginfracost configure get api_key
. If you don't have one, download Infracost and runinfracost register
to get a free API key. -
version
: Optional, defaults to0.9.x
. SemVer ranges are supported, so instead of a full version string, you can use0.9.x
. This enables you to automatically get the latest backward compatible changes in the 0.9 release (e.g. new resources or bug fixes). -
currency
: Optional. Convert output from USD to your preferred ISO 4217 currency, e.g. EUR, BRL or INR. -
pricing-api-endpoint
: Optional. For self-hosted users, endpoint of the Cloud Pricing API, e.g. https://cloud-pricing-api.
This action does not set any direct outputs.