From 90dca41d5d4565bdaf33af248c288666a372130c Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Fri, 21 Nov 2025 22:28:26 +0100 Subject: [PATCH 1/3] Added plan-diff mode readme --- README.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.yaml b/README.yaml index 2e7ec3a2..ee83e853 100644 --- a/README.yaml +++ b/README.yaml @@ -182,6 +182,16 @@ usage: |- ... ``` + ### Plan Diff mode + + The action supports a `plan-diff` mode, which will compare the current plan with the stored plan and fail if there are any differences. + + To enable plan diff mode, set the `plan-diff` input to `true`. + + If plan diff is disabled, the action will apply the stored plan without any verification. + Be aware that this can lead to unexpected changes if infrastructure is changed between the plan and apply steps. + Also the stored plan can be applied only once. Even if the apply failed on any reason the stored plan became outdated and can not be applied again. + ### Workflow example In this example, the action is triggered when certain events occur, such as a manual workflow dispatch or the opening, synchronization, or reopening of a pull request, specifically on the main branch. It specifies specific permissions related to assuming roles in AWS. Within the "apply" job, the "component" and "stack" are hardcoded (`foobar` and `plat-ue2-sandbox`). In practice, these are usually derived from another action. From 3085948fc12df5b4af7f0889a21f98c3b1c8b4b8 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Fri, 21 Nov 2025 22:33:19 +0100 Subject: [PATCH 2/3] Added plan-diff mode readme --- README.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.yaml b/README.yaml index ee83e853..0493aba8 100644 --- a/README.yaml +++ b/README.yaml @@ -188,9 +188,10 @@ usage: |- To enable plan diff mode, set the `plan-diff` input to `true`. - If plan diff is disabled, the action will apply the stored plan without any verification. - Be aware that this can lead to unexpected changes if infrastructure is changed between the plan and apply steps. - Also the stored plan can be applied only once. Even if the apply failed on any reason the stored plan became outdated and can not be applied again. + > [!IMPORTANT] + > If plan diff is disabled, the action will apply the stored plan without any verification. + > Be aware that this can lead to unexpected changes if infrastructure is changed between the plan and apply steps. + > Also the stored plan can be applied only once. Even if the apply failed on any reason the stored plan became outdated and can not be applied again. ### Workflow example From 57b37e97078da295f2b50ae274869d68e7880fc6 Mon Sep 17 00:00:00 2001 From: Igor Rodionov <496956+goruha@users.noreply.github.com> Date: Sat, 22 Nov 2025 00:52:39 +0300 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: PePe Amengual <2208324+jamengual@users.noreply.github.com> --- README.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.yaml b/README.yaml index 0493aba8..63c1b215 100644 --- a/README.yaml +++ b/README.yaml @@ -184,14 +184,14 @@ usage: |- ### Plan Diff mode - The action supports a `plan-diff` mode, which will compare the current plan with the stored plan and fail if there are any differences. + The action provides a `plan-diff` mode that compares the newly generated plan against the previously stored plan and fails the workflow if any differences are detected. To enable plan diff mode, set the `plan-diff` input to `true`. > [!IMPORTANT] - > If plan diff is disabled, the action will apply the stored plan without any verification. - > Be aware that this can lead to unexpected changes if infrastructure is changed between the plan and apply steps. - > Also the stored plan can be applied only once. Even if the apply failed on any reason the stored plan became outdated and can not be applied again. +> When plan-diff is disabled, the action will apply the stored plan without re-validating it. +> This may result in unintended changes if the underlying infrastructure has been modified between the plan and apply steps. +> Additionally, stored plans are single-use: even if an apply operation fails for any reason, the plan becomes outdated and cannot be reused. ### Workflow example