Trying to get terraform plan running on pull requests for our CXone resources. The apply works fine on merge, but plan chokes with a state lock error. Here’s the GitHub Actions snippet I’m using.
name: TF Plan
on: pull_request
jobs:
plan:
runs-on: ubuntu-latest
steps:
- uses: hashicorp/setup-terraform@v2
- run: terraform init
- run: terraform plan -var-file=prod.tfvars
Is there a flag to bypass the lock for read-only operations, or do I need a separate backend config for PRs? The error is just saying the state is locked by the previous run. Running this from America/Mexico_City, so maybe some sync delay? Not sure.