-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:infracost/actions into master
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This is a placeholder action, see https://github.com/infracost/actions/ for the Infracost actions and examples of how to use them. | ||
name: Infracost Actions | ||
description: See cloud cost estimates for Terraform in pull requests. | ||
|
||
author: infracost | ||
branding: | ||
icon: trending-up | ||
color: yellow | ||
inputs: | ||
api-key: | ||
description: Your Infracost API key. It can be retrieved by running `infracost configure get api_key`. If you don't have one, download Infracost (https://www.infracost.io/docs/#quick-start) and run `infracost register` to get a free API key. | ||
required: true | ||
path: | ||
description: The path that will be passed to `infracost breakdown`. This may be a path to a Terraform plan JSON or a Terraform project. Project support requires Terraform to have been installed with hashicorp/setup-terraform@v1. | ||
required: true | ||
behavior: | ||
description: The behavior to use when posting cost estimate comments. Must be one of 'update' | 'delete-and-new' | 'hide-and-new' | 'new'. | ||
required: false | ||
default: update | ||
runs: | ||
using: "composite" | ||
steps: | ||
# Install the Infracost CLI, see https://github.com/infracost/actions/tree/master/setup | ||
# for other inputs such as version, and pricing-api-endpoint (for self-hosted users). | ||
- name: Setup Infracost | ||
uses: infracost/actions/setup@v1 | ||
with: | ||
api-key: ${{ inputs.api-key }} | ||
|
||
# Generate Infracost JSON output, the following docs might be useful: | ||
# Multi-project/workspaces: https://www.infracost.io/docs/multi_project/config_file | ||
# Combine Infracost JSON files: https://www.infracost.io/docs/multi_project/report | ||
- name: Generate Infracost JSON | ||
shell: bash | ||
run: infracost breakdown --path ${{ inputs.path }} --format json --out-file /tmp/infracost.json | ||
# Env vars can be set using the usual GitHub Actions syntax | ||
# env: | ||
# MY_ENV: ${{ secrets.MY_ENV }} | ||
|
||
# See https://github.com/infracost/actions/tree/master/comment | ||
# for other inputs such as target-type. | ||
- name: Post Infracost comment | ||
uses: infracost/actions/comment@v1 | ||
with: | ||
path: /tmp/infracost.json | ||
# Choose the commenting behavior, 'update' is a good default: | ||
behavior: ${{ inputs.behavior }} |
This file contains 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