Repository navigation
fix(terraform-drift): skip the close-issue steps when drift is paused - #64
Merged
Merged
Conversation
A paused run skips the plan step, leaving steps.plan.outputs.exitcode null. The expression engine coerces null and '0' to the number 0 before comparing, so `exitcode == '0'` held and both close-issue steps ran on every paused day. That was latent while those steps used github-script. Since 01b2981 moved them to the local issue-upsert action, they need the .github-workflows checkout, which the pause also skips, so every paused run failed with "Can't find 'action.yml' ... issue-upsert". Requiring the plan step's outcome to be success gates them on the plan having actually run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rGDi1DUjDVprtwLGb8HSm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every paused
terraform-drift.ymlrun has failed since 01b2981 (2026-09-19) with:This was seen in flungo/terraform-grafana-cloud, which has had a committed
.drift-pausedsince June.Cause
When drift is paused, the plan step is skipped, so
steps.plan.outputs.exitcodeisnull. GitHub's expression engine convertsnulland'0'to the number0before comparing them, sosteps.plan.outputs.exitcode == '0'evaluates to true. Both "close … on a clean run" steps therefore ran on every paused day.Before 01b2981 those steps used inline
github-script, so running them did no harm. They now use the localissue-upsertaction, which needs the.github-workflowscheckout. The pause also skips that checkout, so the job crashes.The other
exitcodechecks ('1','2') are unaffected, becausenullconverts to0, not to 1 or 2.Change
steps.plan.outcome == 'success', with a comment explaining why that check matters. The plan step usesset +e, so its outcome is stillsuccesson real runs.docs/reference/terraform-workflow.mdnow says that a paused run doesn't touch drift issues.actionlintpasses locally.🤖 Generated with Claude Code
https://claude.ai/code/session_015rGDi1DUjDVprtwLGb8HSm
Generated by Claude Code