Prompt
Why are my infrastructure changes not applying in CI/CD?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
There are a few common reasons infra changes “don’t apply” in CI/CD, and the root cause is usually one of these:
1) The pipeline isn’t actually running the changed code
- The workflow may be triggered on the wrong branch.
- The CI job may be checking out an old commit/PR base instead of your feature branch.
- Path filters may exclude the files you changed.
- The pipeline may be using a cached artifact or previously built image.
2) The deploy step isn’t using the updated plan/template
- In Terraform: the plan may be generated in one job and applied in another, but the plan file wasn’t refreshed.
- In CloudFormation/ARM/Bicep/Helm/Kustomize: the deploy job may be pointing at an old packaged output.
- A prior stage may be reusing a stale manifest or compiled template.
3) The changes are not being detected as differences
- The desired state already matches what’s in the environment.
- The provider/API normalizes values, so your “change” isn’t actually different.
- Conditional logic or variables evaluate differently in CI than locally.
4) Credentials or environment are pointing somewhere else
- The pipeline may be deploying to a different account/subscription/project/region.
- Wrong workspace, namespace, cluster, or environment variables.
- Secret/context misconfiguration causes deployment to a dev/staging target instead of prod.
5) The pipeline is failing silently or skipping apply
planruns, butapplyis gated by approvals/manual steps and never executes.- The job exits early because of a non-fatal error.
--auto-approveis missing or an approval policy blocks changes.- Drift detection only reports changes, but no actual deployment step exists.
6) Permissions or locks are preventing updates
- The CI role lacks rights to modify the resource.
- State locking prevents apply.
- Resource policies/OPA/Sentinel/branch protection block the deployment.
7) A later step reverts the change
- Another pipeline, GitOps controller, or reconciliation loop overwrites it.
- Helm/operator/GitOps tooling continuously restores the previous desired state.
- A manual hotfix in the environment is being reverted by the next sync.
8) State or cache problems
- Terraform state is stale or incorrect.
- Backend misconfiguration points to the wrong state file.
- Docker/build caches are reusing outdated images or layers.
- Artifact retention means an old package is being deployed.
Quick debugging checklist
- Confirm the pipeline ran for the exact commit with your change.
- Inspect the generated plan/template/artifact in CI.
- Verify the target account/subscription/cluster/namespace.
- Compare
planoutput in CI vs locally. - Check whether
apply/deployactually ran and succeeded. - Look for approvals, policies, or locks blocking execution.
- Check for another controller/pipeline reverting the change.
- Clear caches/rebuild artifacts and retry.
If you want, I can help you debug this more precisely if you tell me:
- which tool you’re using (Terraform, CloudFormation, Helm, etc.),
- which CI/CD system (GitHub Actions, GitLab CI, Jenkins, Azure DevOps, etc.),
- and what “not applying” looks like (no changes detected, apply skipped, changes applied then reverted, etc.).