Skip to content

Commit

Permalink
v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Jul 25, 2020
1 parent b173f0c commit 2452cea
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is one of a suite of terraform related actions - find them at [dflook/terraform-github-actions](https://github.com/dflook/terraform-github-actions).

This actions generates a terraform plan.
If the action is run on `pull_request` events it will add a comment on the PR containing the generated plan.
If the triggering event relates to a PR it will add a comment on the PR containing the generated plan.

<p align="center">
<img src="plan.png" width="600">
Expand Down Expand Up @@ -111,6 +111,8 @@ The [dflook/terraform-apply](https://github.com/dflook/terraform-github-actions/

## Example usage

### Automatically generating a plan

This example workflow runs on every push to an open pull request,
and create or updates a comment with the terraform plan

Expand All @@ -134,3 +136,33 @@ jobs:
with:
path: my-terraform-config
```

### Generating a plan using a comment

This workflow generates a plan on demand, triggered by someone
commenting `terraform plan` on the PR. The action will create or update
a comment on the PR with the generated plan.

```yaml
name: Terraform Plan
on: [issue_comment]
jobs:
plan:
if: github.event.issue.pull_request && contains(github.event.comment.body, 'terraform plan')
runs-on: ubuntu-latest
name: Create terraform plan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.issue.number }}/merge
- name: terraform plan
uses: dflook/terraform-plan@v1
with:
path: my-terraform-config
```
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ outputs:

runs:
using: docker
image: docker://danielflook/terraform-github-actions:v1.3.1
image: docker://danielflook/terraform-github-actions:v1.4.0
entrypoint: /entrypoints/plan.sh

branding:
Expand Down

0 comments on commit 2452cea

Please sign in to comment.