Terraform CI/CD: Passing workspace state to `terraform apply` in GitHub Actions

Setting up a GitHub Actions workflow for our Genesys Cloud resources using the mypurecloud/genesyscloud provider. The terraform plan step works fine on pull requests, but the apply on merge is failing because it can’t find the state file. We’re using remote state stored in S3 with DynamoDB locking.

Here’s the relevant part of the deploy.yml:

- name: Terraform Apply
 run: |
 terraform init
 terraform apply -auto-approve

The error is Error: Failed to load state: stat <path>: no such file or directory. I know the plan step outputs a state file, but the apply step is running in a fresh container context. How do I pass the planned state from the previous job or cache it correctly? I tried using actions/cache with the .terraform directory, but the checksum keeps mismatching because of the terraform.tfstate lock changes. Is there a way to export the plan file and use terraform apply <planfile>? That seems cleaner than shuffling state files around. The provider version is v1.45.0.