Skip to content

feat: add dry_run input - #765

Merged
EndBug merged 5 commits into
mainfrom
cursor/57c082e4
Aug 9, 2026
Merged

feat: add dry_run input#765
EndBug merged 5 commits into
mainfrom
cursor/57c082e4

Conversation

@EndBug

@EndBug EndBug commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a dry_run boolean input (default false) so workflows can validate configuration and preview what the action would do without mutating the repo
  • Staging uses git add --dry-run / git rm --dry-run; commit, tag, push, pull, fetch, checkout, and identity config are logged only
  • Outputs stay at their defaults (committed/pushed/tagged/tag_pushed remain false)

Closes #511

Test plan

  • Run the action with dry_run: true on a dirty working tree and confirm logs show “Would …” steps with no commit/push
  • Run with dry_run: true on a clean tree and confirm “nothing would be committed”
  • Run with dry_run: false (or omitted) and confirm normal add/commit/push still works
  • Confirm CI (npm test + lib integrity) passes

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added an optional dry-run mode, disabled by default.
    • Preview staging, adding, removing, pulling, committing, tagging, and pushing without modifying the repository.
    • Validate planned changes and report whether updates would be staged.
    • Log intended actions and preserve existing outputs when dry-run mode is disabled.
  • Documentation

    • Added guidance on dry-run behavior, validation-only execution, previews, and output values.

Closes #511

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@EndBug, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 07511f9b-c1cf-4663-8b59-ffa06fe96750

📥 Commits

Reviewing files that changed from the base of the PR and between 7dd26ad and b6d6d87.

📒 Files selected for processing (8)
  • .cursor/rules/update-tests.mdc
  • README.md
  • action.yml
  • lib/index.js
  • src/io.ts
  • src/main.ts
  • test/integration/action.test.ts
  • test/integration/helpers.ts
📝 Walkthrough

Walkthrough

The action adds an optional dry_run input. Dry-run mode validates staging changes, reports planned Git operations, and exits before repository configuration, commits, tags, or pushes.

Changes

Dry-run support

Layer / File(s) Summary
Dry-run input contract
action.yml, src/io.ts, README.md
The action declares dry_run with a default of false. Input parsing and documentation describe non-mutating behavior.
Dry-run staging probes
src/main.ts
Add and remove operations use Git --dry-run, return probe results, detect potential staged changes, and validate add operations with an isolated temporary Git index.
Dry-run operation reporting
src/main.ts
The action logs planned identity, fetch, branch, pull, commit, tag, push, and tag-push operations. Clean-tree output distinguishes dry-run execution.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Input as Action input
  participant Main as main
  participant GitCommands as add/remove
  participant Git as Git
  participant Output as Action output
  Input->>Main: provide dry_run=true
  Main->>GitCommands: run staging probes
  GitCommands->>Git: execute add/remove with --dry-run
  Git-->>GitCommands: return probe results
  GitCommands-->>Main: return staging results
  Main->>Output: log planned Git operations
  Main-->>Output: exit without mutation
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding the dry_run input.
Linked Issues check ✅ Passed The changes implement the requested dry-run option and prevent repository mutations while previewing the workflow [#511].
Out of Scope Changes check ✅ Passed The implementation and documentation changes directly support the dry-run objective, with no unrelated changes identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch cursor/57c082e4
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/57c082e4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/io.ts`:
- Line 13: Update the dry_run property in InputTypes from string to boolean so
getInput('dry_run', true) produces a boolean-compatible value for the dryRun
flag used by main.ts, preventing non-boolean string values from controlling
execution.

In `@src/main.ts`:
- Around line 397-400: Update the staging-validation flow around
assertNoUnexpectedGitlinks to run during dryRun as well as normal execution. For
dry runs, use an isolated temporary Git index, apply the staging arguments to
that index, inspect its cached raw diff, and validate it without modifying the
repository’s real index; preserve the existing normal-execution behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: feccb94a-aff3-463f-b24a-5912c5b63572

📥 Commits

Reviewing files that changed from the base of the PR and between df70d11 and 22771a6.

📒 Files selected for processing (5)
  • README.md
  • action.yml
  • lib/index.js
  • src/io.ts
  • src/main.ts

Comment thread src/io.ts Outdated
Comment thread src/main.ts Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main.ts`:
- Around line 430-435: Update the temporary-index setup in the main flow around
indexPath so repositories where HEAD does not resolve initialize tmpIndex as an
empty index instead of running git read-tree HEAD. Preserve copying an existing
index and retain the current read-tree behavior when HEAD resolves, so git add
--dry-run and first-commit execution continue to work.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c876f1cd-3d2a-445c-9a43-2a6629d1f677

📥 Commits

Reviewing files that changed from the base of the PR and between 22771a6 and f8129a1.

📒 Files selected for processing (3)
  • lib/index.js
  • src/io.ts
  • src/main.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/io.ts

Comment thread src/main.ts Outdated
EndBug and others added 3 commits August 9, 2026 23:08
Co-authored-by: Cursor <cursoragent@cursor.com>
Reconcile dry_run with push_attempts helpers and cover dry_run in integration tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@EndBug
EndBug merged commit e1aaefa into main Aug 9, 2026
11 checks passed
@EndBug
EndBug deleted the cursor/57c082e4 branch August 9, 2026 21:16
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.

Is there a dry-run input?

1 participant