Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto apply if no resources changed #333

Open
edscve opened this issue Mar 11, 2024 · 1 comment
Open

auto apply if no resources changed #333

edscve opened this issue Mar 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@edscve
Copy link

edscve commented Mar 11, 2024

Suggestion

We use the apply and plan actions trough pull requests. We also use Dependabot to automatically update our Versions of Workflows and AWS, Azure dependencies.
Dependabot automatically changes the version and opens a pull request against main to push the new version. Then the dflook actions start and check if anything changes, 90% of them are "No changes. Your infrastructure matches the configuration."

What would be greate if the "auto_approve: true" would have another options, "empty applys" so that the empty changes and the version changes get merged automatically without human interaction.

@edscve edscve added the enhancement New feature or request label Mar 11, 2024
@dflook
Copy link
Owner

dflook commented Mar 11, 2024

You can apply plans that have no changes by using a conditional apply step:

    steps:
      - name: terraform plan
        id: plan
        uses: dflook/terraform-plan@v1
        with:
          path: terraform
      - name: terraform apply
        if: steps.plan.outputs.changes == false
        uses: dflook/terraform-apply@v1
        with:
          path: terraform

But I'm not sure I understand what your trying to do. This would apply empty plans for an open PR but it's not clear how you intend the changes to be merged, or what should happen if the plan has changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants