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

Skip Terraform apply if plan has 0 changes #9

Closed
staticaland opened this issue Aug 17, 2023 · 3 comments
Closed

Skip Terraform apply if plan has 0 changes #9

staticaland opened this issue Aug 17, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@staticaland
Copy link
Contributor

staticaland commented Aug 17, 2023

Description

Skip Terraform apply if plan has 0 changes.

-detailed-exitcode - Returns a detailed exit code when the command exits. When provided, this argument changes the exit codes and their meanings to provide more granular information about what the resulting plan contains:

0 = Succeeded with empty diff (no changes)
1 = Error
2 = Succeeded with non-empty diff (changes present)

Therefore, we can use steps.plan.outputs.exitcode and only run the apply job if the exit code is 2.

Motivation

Saves time and money.

@yngvark yngvark added the enhancement New feature or request label Aug 30, 2023
@staticaland staticaland transferred this issue from another repository Sep 5, 2023
@staticaland
Copy link
Contributor Author

Will be solved in #41

@staticaland
Copy link
Contributor Author

I wanted to add labels to this issue. We should add labels to repositories with Terraform through this code.

@staticaland
Copy link
Contributor Author

#83

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

Successfully merging a pull request may close this issue.

2 participants