Skip to content

Commit

Permalink
feat: repurpose to generic artifact upload (#5)
Browse files Browse the repository at this point in the history
* feat: repurpose to generic artifact upload

* chore: build

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
abemedia and github-actions[bot] authored Aug 19, 2021
1 parent 72982cc commit 3267e8c
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 5,046 deletions.
45 changes: 10 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,23 @@
# terraform-upload-plan-action
# Create Artifact Action

This GitHub action parses and uploads the result of `terraform plan` for use with [terraform-plan-comment-action](https://github.com/theappnest/terraform-plan-comment-action).
This GitHub action creates a file from a variable and uploads it to an artifact.

## Usage

```yaml
jobs:
modules:
artifact:
runs-on: ubuntu-latest
steps:
- uses: theappnest/terraform-monorepo-action@v1
id: modules
outputs:
modules: ${{ steps.modules.outputs.modules }}

terraform:
runs-on: ubuntu-latest
needs: modules
strategy:
matrix:
module: ${{ fromJson(needs.modules.outputs.modules) }}
defaults:
run:
working-directory: ${{ matrix.module }}
steps:
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1
- run: terraform init
- run: terraform plan
id: plan
- uses: theappnest/terraform-upload-plan-action@v1
- uses: theappnest/create-artifact-action@v1
with:
module: ${{ matrix.module }}
plan: ${{ steps.plan.outputs.stdout }}

comment:
runs-on: ubuntu-latest
needs: terraform
steps:
- uses: theappnest/terraform-plan-comment-action@v1
name: hello
path: greetings/hello.md
content: Hello World
```
## Inputs
- `name` (Optional) The name of the artifact to create. Defaults to `terraform-plan`.
- `module` The name of the Terraform module.
- `plan` The output of `terraform plan`.
- `name` (Optional) The name of the artifact to create. Defaults to `artifact`.
- `path` The path of the created file.
- `content` The contents of the created file.
14 changes: 7 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: terraform-upload-plan
description: Parses and uploads the result of `terraform plan`.
name: Create Artifact
description: Creates a file from a variable and uploads it to an artifact.
author: DREST LTD
inputs:
name:
description: The name of the artifact to create.
default: artifact
required: false
default: terraform-plan
module:
description: The name of the Terraform module.
path:
description: The path of the created file.
required: true
plan:
description: The output of `terraform plan`.
content:
description: The contents of the created file.
required: true
runs:
using: 'node12'
Expand Down
Loading

0 comments on commit 3267e8c

Please sign in to comment.