Skip to content

Commit

Permalink
Merge branch 'master' of github.com:infracost/actions into master
Browse files Browse the repository at this point in the history
  • Loading branch information
alikhajeh1 committed Dec 5, 2021
2 parents be17a59 + 62e18ed commit e7968ab
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,11 @@ export GITHUB_TOKEN=<GITHUB_PERSONAL_ACCESS_TOKEN>
npm run examples:update_golden
```

# Releases

One of the Infracost team members should follow these steps to release this repo:
1. `git checkout master && git pull origin master`
2. `git tag vX.Y.Z && git push origin vX.Y.Z` (following semantic versioning)
3. `git tag -f v1 && git push origin v1 -f` (assuming the new release is backward compatible with v1)
4. Confirm that the [repo tags](https://github.com/infracost/actions/tags) show matching git SHAs for vX.Y.X and v1.
5. Create a release for v.X.Y.Z and publish it in the [GitHub Marketplace](https://github.com/marketplace/actions/infracost-actions).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The [examples](examples) directory demonstrates how these actions can be used in
- [Multi-Terraform workspace](examples/multi-terraform-workspace): multiple Terraform workspaces using the Infracost [config file](https://www.infracost.io/docs/multi_project/config_file)
- [Private Terraform module](examples/private-terraform-module): a Terraform project using a private Terraform module
- [Thresholds](examples/thresholds): only post a comment when cost thresholds are exceeded
- [Slack](slack): send cost estimates to Slack
- [Slack](examples/slack): send cost estimates to Slack

## Actions

Expand Down
47 changes: 47 additions & 0 deletions action.yml
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 }}
2 changes: 1 addition & 1 deletion comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
description: The path to the `infracost breakdown` JSON that will be passed to `infracost output`. For multiple paths, pass a glob pattern (e.g. "infracost_*.json", glob needs quotes) or a JSON array of paths.
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'.
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
target-type:
Expand Down

0 comments on commit e7968ab

Please sign in to comment.