Setting up a GitHub Actions workflow to run terraform plan on PR and apply on merge. The plan step works fine, but the apply job on the main branch always fails with Error acquiring the state lock. It seems like the plan job isn’t releasing the lock properly before the apply job starts, even though they are separate runners. Here’s the workflow :
on:
push:
branches: [main]
jobs:
apply:
runs-on: ubuntu-latest
steps:
- name: Apply
run: terraform apply -auto-approve
Is there a specific flag or backend config I’m missing to ensure the lock releases between steps?