Skip to content

Prevent workflow cancellation while Terraform holds a state lock.#1253

Merged
mfjarvis merged 4 commits intomasterfrom
VED-000-prevent-terraform-cancellation
Feb 27, 2026
Merged

Prevent workflow cancellation while Terraform holds a state lock.#1253
mfjarvis merged 4 commits intomasterfrom
VED-000-prevent-terraform-cancellation

Conversation

@mfjarvis
Copy link
Contributor

@mfjarvis mfjarvis commented Feb 27, 2026

Summary

  • 🤖 Operational or Infrastructure Change
  • ⚠️ Potential issues that might be caused by this change

Override the default success() condition on the Terraform plan and apply steps. This means requests to cancel the workflow during these steps will be ignored, preventing the Terraform process from being killed while it holds a state lock. It does also mean that manual cancellations of the workflow will be ignored during these steps. However, if cancellation is requested during the Terraform plan step, the Terraform apply step will not run, and cancelling the workflow during the Terraform apply is probably not a good idea anyway (but can still be done if necessary using the force-cancel API operation).

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-cancellation
https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#status-check-functions
https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#force-cancel-a-workflow-run

Reviews Required

  • Dev
  • Test
  • Tech Author
  • Product Owner

Review Checklist

ℹ️ This section is to be filled in by the reviewer.

  • I have reviewed the changes in this PR and they fill all of the acceptance criteria of the ticket.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • If there were changes that are outside of the regular release processes e.g. account infrastructure to setup, manual setup for external API integrations, secrets to set, then I have checked that the developer has flagged this to the Tech Lead as release steps.
  • I have checked that no Personal Identifiable Data (PID) is logged as part of the changes.

@github-actions
Copy link
Contributor

This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket:

VED-000

dlzhry2nhs
dlzhry2nhs previously approved these changes Feb 27, 2026
@sonarqubecloud
Copy link

@mfjarvis mfjarvis merged commit 0d06d74 into master Feb 27, 2026
17 checks passed
@mfjarvis mfjarvis deleted the VED-000-prevent-terraform-cancellation branch February 27, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants