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

Detect diff #422

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Detect diff #422

wants to merge 3 commits into from

Conversation

dcfsc
Copy link

@dcfsc dcfsc commented Jun 24, 2024

We run Terraform pipelines in GitHub Actions to detect drift. Currently, you can either use the default return value or use the -extended-return option to return error code 2 when the plan detects a difference. Currently the code see code 2 and accepts that as a successful run. We want to see that as a failure (or warning if GHA ever supports a warning outcome).

Existing code:

terraform plan -extended-return exit code pipeline result
no changes X 0 Green / Success
resources changed T 2 Green/Success
F 0 Red / Fail
error X >3 Red / Fail

| ads | fail_on_detected_diff | result |

terraform plan -extended-return fail_on_detected_diff exit code pipeline result
no changes 0 false Green / Success
resources changed 2 false Green/Success
error >3 false Red / Fail
no changes 0 false Green / Success
resources changed 2 false Green/Success
error >3 false Red / Fail

more logging -- is it working?

more logging -- is it working? rerelease

fix logging 2

more logging

more logging

add fail_on_detected_diff

add fail_on_detected_diff 2

add fail_on_detected_diff 3

add fail_on_detected_diff 4 fix

plan_fail id; two test

more debug

more debug - try getBooleanInput

more debug - try getBooleanInput : add debug to raw js code

more debug - try getBooleanInput : add debug stdout to raw js code

try using "fail" as trigger instead of boolean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant