Skip to content

Commit

Permalink
v1.40.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Jan 10, 2024
1 parent 61d32f3 commit 8d1a5d6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ These input values must be the same as any [`dflook/terraform-plan`](https://git
A friendly name for the environment the Terraform configuration is for.
This will be used in the PR comment for easy identification.

It must be the same as the `label` used in the corresponding [`dflook/terraform-plan`](https://github.com/dflook/terraform-github-actions/tree/main/terraform-plan) command.
It must be the same as the `label` used in the corresponding [`dflook/terraform-plan`](https://github.com/dflook/terraform-github-actions/tree/main/terraform-plan) action.

- Type: string
- Optional
Expand Down Expand Up @@ -157,11 +157,33 @@ These input values must be the same as any [`dflook/terraform-plan`](https://git
- Optional
- Default: false

* `plan_path`

Path to a plan file to apply. This would have been generated by a previous [`dflook/terraform-plan`](https://github.com/dflook/terraform-github-actions/tree/main/terraform-plan) action.

The default behaviour when this is not set is to generate a plan from the current configuration and compare it to the plan attached to the PR comment.
If it is logically the same, the plan will be applied.

When this is set to a plan file, the plan will not be generated again. If it is the exact same plan as the one attached to the PR comment, it will be applied.
This will be faster than generating a new plan.

There are downsides to applying a stored plan:
- The plan may contain sensitive information so must be stored securely, possibly outside of GitHub.
- It does not account for any changes that have occurred since it was generated, and may no longer be correct.
- Plans must be generated and applied in strict order. Multiple open PRs will cause conflicts if they are applied out of order.
- Plans are not portable between platforms.
- Terraform and provider versions must match between the plan generation and apply.

When `auto_approve` is set to `true`, the plan will be applied without checking if it is the same as the one attached to the PR comment.

- Type: string
- Optional

* `auto_approve`

When set to `true`, generated plans are always applied.
When set to `true`, plans are always applied.

The default is `false`, which requires plans to have been approved through a pull request.
The default is `false`, which requires plans to have been added to a pull request comment.

- Type: bool
- Optional
Expand Down
6 changes: 5 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ inputs:
description: Create and apply a plan to destroy all resources
required: false
default: "false"
plan_path:
description: Path to the plan file to apply.
required: false
default: ""

outputs:
text_plan_path:
Expand All @@ -68,7 +72,7 @@ outputs:

runs:
using: docker
image: docker://danielflook/terraform-github-actions@sha256:58b279738cab51c9bb4b8201afeff9e585ce72f9a30ee0490896ad8827e7e96b
image: docker://danielflook/terraform-github-actions@sha256:4c0a6f98ddafa03699d7fb059010f6b5f88d5a8903d1d2e66660ec799de9efad
entrypoint: /entrypoints/apply.sh

branding:
Expand Down

0 comments on commit 8d1a5d6

Please sign in to comment.