Skip to content

Update to support Terraform cloud with Terraform 1.6 #671

Update to support Terraform cloud with Terraform 1.6

Update to support Terraform cloud with Terraform 1.6 #671

Workflow file for this run

name: Test terraform-plan
on:
- pull_request
jobs:
no_changes:
runs-on: ubuntu-latest
name: No changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/no_changes
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "false" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .format_version "${{ steps.plan.outputs.json_plan_path }}") != "1.2" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "No changes" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if ! [[ -f '${{ steps.plan.outputs.plan_path }}' ]]; then
echo "::error:: plan_path not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 0 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
no_changes_no_comment:
runs-on: ubuntu-latest
name: No changes without comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/no_changes
add_github_comment: false
- name: Verify outputs
run: |
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .format_version "${{ steps.plan.outputs.json_plan_path }}") != "1.2" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "No changes" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
plan_change_comment_11:
runs-on: ubuntu-latest
name: Change terraform 11
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan_11
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "true" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
if [[ -n "${{ steps.plan.outputs.json_plan_path }}" ]]; then
echo "::error:: json_plan_path should not be set - not available with terraform 11"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_add }} -ne 1 ]]; then
echo "::error:: to_add not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_change }} -ne 0 ]]; then
echo "::error:: to_change not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_destroy }} -ne 0 ]]; then
echo "::error:: to_destroy not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 1 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
plan_change_comment_12:
runs-on: ubuntu-latest
name: Change terraform 12
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan_12
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "true" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .output_changes.s.actions[0] "${{ steps.plan.outputs.json_plan_path }}") != "create" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_add }} -ne 1 ]]; then
echo "::error:: to_add not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_change }} -ne 0 ]]; then
echo "::error:: to_change not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_destroy }} -ne 0 ]]; then
echo "::error:: to_destroy not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 1 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
plan_change_comment_13:
runs-on: ubuntu-latest
name: Change terraform 13
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan_13
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "true" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .output_changes.s.actions[0] "${{ steps.plan.outputs.json_plan_path }}") != "create" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_add }} -ne 1 ]]; then
echo "::error:: to_add not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_change }} -ne 0 ]]; then
echo "::error:: to_change not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_destroy }} -ne 0 ]]; then
echo "::error:: to_destroy not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 1 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
plan_change_comment_14:
runs-on: ubuntu-latest
name: Change terraform 14
env:
TF_PLAN_COLLAPSE_LENGTH: 30
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan_14
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "true" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .output_changes.s.actions[0] "${{ steps.plan.outputs.json_plan_path }}") != "create" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_add }} -ne 1 ]]; then
echo "::error:: to_add not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_change }} -ne 0 ]]; then
echo "::error:: to_change not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_destroy }} -ne 0 ]]; then
echo "::error:: to_destroy not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 1 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
plan_change_comment_15:
runs-on: ubuntu-latest
name: Change terraform 15
env:
TF_PLAN_COLLAPSE_LENGTH: 30
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan_15
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "true" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .output_changes.s.actions[0] "${{ steps.plan.outputs.json_plan_path }}") != "create" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_add }} -ne 1 ]]; then
echo "::error:: to_add not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_change }} -ne 0 ]]; then
echo "::error:: to_change not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_destroy }} -ne 0 ]]; then
echo "::error:: to_destroy not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 1 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
plan_change_comment_15_4:
runs-on: ubuntu-latest
name: Change terraform 15.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan_15_4
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "true" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .output_changes.s.actions[0] "${{ steps.plan.outputs.json_plan_path }}") != "create" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_add }} -ne 1 ]]; then
echo "::error:: to_add not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_change }} -ne 0 ]]; then
echo "::error:: to_change not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_destroy }} -ne 0 ]]; then
echo "::error:: to_destroy not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 1 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
plan_change_comment_latest:
runs-on: ubuntu-latest
name: Change latest terraform
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan
- name: Verify outputs
run: |
echo "changes=${{ steps.plan.outputs.changes }}"
if [[ "${{ steps.plan.outputs.changes }}" != "true" ]]; then
echo "::error:: output changes not set correctly"
exit 1
fi
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .output_changes.s.actions[0] "${{ steps.plan.outputs.json_plan_path }}") != "create" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_add }} -ne 1 ]]; then
echo "::error:: to_add not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_change }} -ne 0 ]]; then
echo "::error:: to_change not set correctly"
exit 1
fi
if [[ ${{ steps.plan.outputs.to_destroy }} -ne 0 ]]; then
echo "::error:: to_destroy not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 1 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
plan_change_no_comment:
runs-on: ubuntu-latest
name: Change without github comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
id: plan
with:
path: tests/workflows/test-plan/plan
add_github_comment: false
- name: Verify outputs
run: |
cat '${{ steps.plan.outputs.json_plan_path }}'
if [[ $(jq -r .output_changes.s.actions[0] "${{ steps.plan.outputs.json_plan_path }}") != "create" ]]; then
echo "::error:: json_plan_path not set correctly"
exit 1
fi
if ! grep -q "Terraform will perform the following actions" '${{ steps.plan.outputs.text_plan_path }}'; then
echo "::error:: text_plan_path not set correctly"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
error:
runs-on: ubuntu-latest
name: Error
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
continue-on-error: true
id: plan
with:
path: tests/workflows/test-plan/error
- name: Check invalid
run: |
if [[ "${{ steps.plan.outcome }}" != "failure" ]]; then
echo "Plan did not fail correctly"
exit 1
fi
if [[ -n "${{ steps.plan.outputs.json_plan_path }}" ]]; then
echo "::error:: json_plan_path should not be set"
exit 1
fi
if [[ -n "${{ steps.plan.outputs.text_plan_path }}" ]]; then
echo "::error:: text_plan_path should not be set"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
- name: Test output expressions
if: steps.plan.outputs.to_add != 0 || steps.plan.outputs.to_change != 0 || steps.plan.outputs.to_destroy != 0
run: |
echo "if expression should not have evaluated true"
exit 1
error_no_comment:
runs-on: ubuntu-latest
name: Error without comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
continue-on-error: true
id: plan
with:
path: tests/workflows/test-plan/error
add_github_comment: false
- name: Check invalid
run: |
if [[ "${{ steps.plan.outcome }}" != "failure" ]]; then
echo "Plan did not fail correctly"
exit 1
fi
if [[ -n "${{ steps.plan.outputs.json_plan_path }}" ]]; then
echo "::error:: json_plan_path should not be set"
exit 1
fi
if [[ -n "${{ steps.plan.outputs.text_plan_path }}" ]]; then
echo "::error:: text_plan_path should not be set"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
plan_without_token:
runs-on: ubuntu-latest
name: Add comment without token
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
continue-on-error: true
id: plan
with:
path: tests/workflows/test-plan/error
- name: Check invalid
run: |
if [[ "${{ steps.plan.outcome }}" != "failure" ]]; then
echo "Plan did not fail correctly"
exit 1
fi
if [[ -n "${{ steps.plan.outputs.json_plan_path }}" ]]; then
echo "::error:: json_plan_path should not be set"
exit 1
fi
if [[ -n "${{ steps.plan.outputs.text_plan_path }}" ]]; then
echo "::error:: text_plan_path should not be set"
exit 1
fi
if [[ -n "${{ steps.apply.outputs.run_id }}" ]]; then
echo "::error:: run_id should not be set"
exit 1
fi
plan_single_variable:
runs-on: ubuntu-latest
name: Plan single variable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/vars
variables: |
my_var="single"
var_file: tests/workflows/test-plan/test.tfvars
plan_single_sensitive_variable:
runs-on: ubuntu-latest
name: Plan single sensitive variable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/single_sensitive_variable
variables: |
my_sensitive_string = "password123"
plan_sensitive_variables:
runs-on: ubuntu-latest
name: Plan variables some which are sensitive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/sensitive_variables
variables: |
my_string="hello"
my_int = 23
my_float = 3.14
my_sensitive_string = "password123"
complex = [
{
internal = 8300
external = 8300
protocol = "tcp"
animals = ["dog", "cat"]
}
]
complex_sensitive = [
{
internal = 100
external = 100
protocol = "udp"
fruits = ["apple", "banana"]
}
]
plan_sensitive_var:
runs-on: ubuntu-latest
name: Plan using deprecated var and sensitive variable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/sensitive_var
var: my_sensitive_var=hello
plan_change_run_commands:
runs-on: ubuntu-latest
name: Change with shell init commands
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/plan
add_github_comment: false
env:
TERRAFORM_PRE_RUN: |
echo "testing command 1"
echo "testing command 2"
default_path:
runs-on: ubuntu-latest
name: Default path
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Copy
run: cp tests/workflows/test-plan/plan/main.tf ./main.tf
- name: Plan
uses: ./terraform-plan
with:
label: test-plan default_path
path_does_not_exist:
runs-on: ubuntu-latest
name: Error with invalid paths
steps:
- name: Checkout
uses: actions/checkout@v3
- name: path
uses: ./terraform-plan
id: path
continue-on-error: true
with:
path: nope
add_github_comment: false
- name: var_file
uses: ./terraform-plan
id: var_file
continue-on-error: true
with:
path: tests/workflows/test-plan/plan
var_file: |
var_file/doesnt/exist.tfvars
var_file/doesnt/exist2.tfvars
add_github_comment: false
- name: backend_config_file
uses: ./terraform-plan
id: backend_config_file
continue-on-error: true
with:
path: tests/workflows/test-plan/plan
backend_config_file: backend_config/doesnt/exist.tfvars
add_github_comment: false
- name: Check invalid
run: |
if [[ "${{ steps.path.outcome }}" != "failure" ]]; then
echo "Non existant path did not fail correctly"
exit 1
fi
if [[ "${{ steps.var_file.outcome }}" != "failure" ]]; then
echo "Non existant var_file did not fail correctly"
exit 1
fi
if [[ "${{ steps.backend_config_file.outcome }}" != "failure" ]]; then
echo "Non existant backend_config_file did not fail correctly"
exit 1
fi
test_plan_1_4:
runs-on: ubuntu-latest
name: Test plan text on Terraform 1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Apply
uses: ./terraform-apply
with:
path: tests/workflows/test-plan/plan
auto_approve: true
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/plan
label: test-plan test_plan_1_4
arm64:
runs-on: buildjet-2vcpu-ubuntu-2204-arm
name: Test on arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/plan
label: arm64
always_new:
runs-on: ubuntu-latest
name: always-new
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan with label
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/always-new
label: always-new SHOULD BE OUTDATED
- name: Plan 2 with label
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/always-new
label: always-new SHOULD BE OUTDATED
add_github_comment: always-new
- name: Plan
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/always-new
- name: Plan 2
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/always-new
add_github_comment: always-new
colours:
runs-on: ubuntu-latest
name: Full colour plan for diff highlighting
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan with colours
uses: ./terraform-plan
with:
path: tests/workflows/test-plan/colours
label: test-plan colours
variables:
diff=true
self-hosted:
runs-on: self-hosted
name: Self-hosted runner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
with:
label: test-plan self-hosted
path: tests/workflows/test-plan/self-hosted
- name: Plan Again
uses: ./terraform-plan
with:
label: test-plan self-hosted
path: tests/workflows/test-plan/self-hosted