Skip to content

fix(terraform-drift): skip the close-issue steps when drift is paused - #64

Merged
flungo merged 1 commit into
mainfrom
claude/drift-paused-close-steps
Sep 27, 2026
Merged

flungo merged 1 commit into
mainfrom
claude/drift-paused-close-steps

Conversation

@flungo

@flungo flungo commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Problem

Every paused terraform-drift.yml run has failed since 01b2981 (2026-09-19) with:

Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '.github-workflows/.github/actions/issue-upsert'

This was seen in flungo/terraform-grafana-cloud, which has had a committed .drift-paused since June.

Cause

When drift is paused, the plan step is skipped, so steps.plan.outputs.exitcode is null. GitHub's expression engine converts null and '0' to the number 0 before comparing them, so steps.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 local issue-upsert action, which needs the .github-workflows checkout. The pause also skips that checkout, so the job crashes.

The other exitcode checks ('1', '2') are unaffected, because null converts to 0, not to 1 or 2.

Change

  • Both close steps now also require steps.plan.outcome == 'success', with a comment explaining why that check matters. The plan step uses set +e, so its outcome is still success on real runs.
  • docs/reference/terraform-workflow.md now says that a paused run doesn't touch drift issues.

actionlint passes locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_015rGDi1DUjDVprtwLGb8HSm


Generated by Claude Code

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
@flungo
flungo marked this pull request as ready for review September 27, 2026 09:18
@flungo
flungo merged commit 9eea817 into main Sep 27, 2026
12 checks passed
@flungo
flungo deleted the claude/drift-paused-close-steps branch September 27, 2026 10:59
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.

2 participants