I use Gitlab CI/CD to provision infrastructure with Terraform. I currently have a 3 stages pipeline (init, plan, apply) that works great with a manual apply job. The plan job shares a plan artefact with the apply job.
Sometimes the plan is empty (no resource to change) but the apply job is still mandatory. Do you know a way to avoid running the apply job when the plan is empty ? Or to automatically (instead of manually) run the apply job when the plan is empty ?