Skip to content

feat: add opt-in dry_run input to skip commit/apply#9

Merged
hisco merged 1 commit into
mainfrom
dry-run-support
May 18, 2026
Merged

feat: add opt-in dry_run input to skip commit/apply#9
hisco merged 1 commit into
mainfrom
dry-run-support

Conversation

@hisco
Copy link
Copy Markdown
Contributor

@hisco hisco commented May 18, 2026

Summary

Adds a new dry_run boolean input (default 'false') to gate the two terminal mutation steps:

  • Commit changes for GitOps (skyhook-io/git-sync-commit@v1) - now if: mode == 'gitops' && inputs.dry_run != 'true'
  • Apply with kubectl (skyhook-io/kustomize-apply@v1) - now if: mode == 'kubectl' && inputs.dry_run != 'true'

Adds a new Dry-run notice step that fires when dry_run == 'true' and logs to stdout which terminal step was skipped plus the inputs it would have received. The existing Deployment plan summary step (unchanged) already runs kustomize build and echoes the rendered manifests on every invocation, so dry-run users see the same plan output as a real run, just without the commit/apply.

All pre-deploy steps (Resolve image inputs, Update kustomize manifests, Inspect, Detect GitOps mode, Set deployment mode, Deployment context, Deployment plan summary) run unchanged - that is the point: verify what would deploy.

Use case: rehearsal / preview runs. Image build + push (cheap, reusable) happens at the caller workflow level; this action stops short of the GitOps commit or kubectl apply so users can validate the planned deployment without prod blast radius.

Example Dry-run notice output (GitOps mode)

==================================================
🔍 DRY RUN - deploy step skipped
==================================================
Skipped: Commit changes for GitOps (skyhook-io/git-sync-commit@v1)
  path: .
  commit_message: Deploy radar-hub to staging [skip ci]
  file_pattern: deploy/overlays/staging/*
==================================================

Security hardening

The Dry-run notice step passes all values via env: block ($VAR references in the shell) rather than ${{ }} interpolation into the run: body. Prevents GitHub Actions script injection through operator-supplied fields such as commit_message.

Backwards compatibility

  • New input defaults to 'false'. Callers that omit it get current behavior bit-for-bit identical.
  • The modified if: conditions collapse to the original predicate when dry_run is unset ('false' != 'true' is true, so && inputs.dry_run != 'true' is a no-op).
  • The new Dry-run notice step is gated by if: inputs.dry_run == 'true' and never fires for default callers.
  • No output channels changed; existing outputs (mode, namespace, deployment, workloads_json, managed_by) unchanged.
  • @v1 major-version tag remains additive-only.

Coordination with open PRs

Test plan

  • Caller invokes with dry_run: true in GitOps mode → Commit changes for GitOps skips, Dry-run notice logs the skipped step + would-have-been inputs, deploy repo gets no commit
  • Caller invokes with dry_run: true in kubectl mode → Apply with kubectl skips, Dry-run notice logs the skipped step + would-have-been inputs, no kubectl apply against the cluster
  • Caller invokes with dry_run: false (or omitted) → behavior identical to current @v1
  • commit_message containing shell metacharacters (e.g. "; echo PWNED; #) in a dry-run → printed as a literal string, no injection

Comment thread action.yml Outdated
@hisco hisco force-pushed the dry-run-support branch from 857efe0 to 9c96e14 Compare May 18, 2026 09:07
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9c96e14. Configure here.

Comment thread action.yml
else
echo "Skipped: deploy step (mode=${{ steps.mode.outputs.mode }})"
fi
echo "==================================================" No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dry-run step writes to stdout, not step summary

Medium Severity

The PR description and test plan explicitly state that the dry-run step writes to $GITHUB_STEP_SUMMARY for review in the run UI, and includes the full kustomize build output. However, the implementation only uses echo to stdout — GITHUB_STEP_SUMMARY appears nowhere in the file. The dry-run output will be buried in action logs instead of being surfaced in the GitHub step summary panel, which defeats the stated purpose of the feature. The kustomize build output mentioned in the description is also absent.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9c96e14. Configure here.

Comment thread action.yml Outdated
When dry_run=true, the action runs validation, image resolution, manifest
render, and GitOps-mode detection end-to-end but skips the two terminal
mutation steps (git-sync-commit for GitOps mode, kustomize-apply for
kubectl mode). New Dry-run summary step renders the manifests into
$GITHUB_STEP_SUMMARY for review.

Default 'false'; absent input = current behavior bit-for-bit.
@hisco hisco force-pushed the dry-run-support branch from 9c96e14 to 1d30731 Compare May 18, 2026 09:20
@hisco hisco merged commit 7cf8cc7 into main May 18, 2026
1 check passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant