Skip to content

Auto plan runs after initial plan upon any file change. Filters ignored #5326

Open
@timvia

Description

@timvia

Overview of the Issue

We have a set of terraform plans that on completion creates config files which are then commited via workflow steps.

The issue we have is that we use autoplan and automerge. Upon the commit atlantis re-runs the plan even though no .tf files have been edited. Our created files are only .yml. This commit and autoplan blocks the automerge from completing.

Atlantis version v0.32.0

Example atlantis.yaml

---
version: 3
automerge: true

projects:
- name: project name
  dir: ./project/terraform
  workspace: default
  delete_source_branch_on_merge: true
  autoplan:
    when_modified: ["*.tf"]
    enabled: true
  apply_requirements: [mergeable]
  workflow: deployment_workflow

workflows
  deployment_workflow:
    plan:
      steps: [init, plan]
    apply:
      steps:
        - apply
        - run: |
            #!/bin/bash
            set -euxo pipefail

            cd $DIR/..
            if ! git diff --exit-code; then
              git add .
              git commit -m "chore: Adding terraform generated files" --author="atlantis <[email protected]>"
              git push
            fi

Describe the solution you'd like

Atlantis should not be triggering a plan, no *.tf files were modified. The files are also outside of the project folder ./project/config.

Explicitly ignoring .yml does not prevent the plan. It seems that after an initial commit requiring a plan to be triggered will then trigger a new plan upon any file change. It is ignoring the filter.

To work around this we have to disable auto plan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions