Skip to content

fix: resolve absolute cwd without dumping the minified bundle (#495) - #772

Merged
EndBug merged 2 commits into
mainfrom
cursor/9eddbc12
Aug 14, 2026
Merged

EndBug merged 2 commits into
mainfrom
cursor/9eddbc12

Conversation

@EndBug

@EndBug EndBug commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Resolve cwd with path.resolve so absolute paths (e.g. ${{ github.workspace }}/…) work instead of being joined onto process.cwd().
  • Construct simple-git after validating the directory inside the async IIFE, so missing cwd fails via core.setFailed instead of dumping the minified lib/index.js bundle (Currently outputting a bunch of code when this fails...  #495).
  • Document relative/absolute cwd usage and that $GITHUB_WORKSPACE is not expanded in with:.

Test plan

  • Unit tests for resolveBaseDir / assertWorkingDirectory
  • Integration: absolute cwd with a different process.cwd() commits into the fixture
  • Integration: missing cwd fails with a clear message and without dumping the bundle
  • npm test (60 tests + lint) passed via pre-commit hook

Made with Cursor

Summary by CodeRabbit

  • Documentation

    • Clarified working-directory input support for relative and absolute paths.
    • Documented the correct workflow syntax for referencing the workspace directory.
    • Recommended checking out repository content before use.
  • Bug Fixes

    • Working-directory inputs are now resolved and validated before execution.
    • Added clear errors for missing paths and paths that are not directories.
    • Improved support for absolute working directories independent of process location.
  • Tests

    • Added coverage for path resolution, validation, successful execution, and failure handling.

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

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9568d5c4-65dc-4bce-95a4-0f1819779204

📥 Commits

Reviewing files that changed from the base of the PR and between 70f2a15 and fc525e4.

📒 Files selected for processing (8)
  • README.md
  • action.yml
  • lib/index.js
  • src/main.ts
  • src/util.ts
  • test/integration/action.test.ts
  • test/integration/helpers.ts
  • test/util.test.ts

📝 Walkthrough

Walkthrough

The action now resolves relative or absolute cwd inputs, validates the resolved path, and initializes Git with that path. Documentation and tests cover workspace expressions, successful commits, and invalid directories.

Changes

Working directory handling

Layer / File(s) Summary
Resolve and validate the working directory
src/util.ts, src/main.ts, README.md, action.yml, test/util.test.ts
The action resolves relative and absolute paths, validates directory existence, and initializes Git after validation. Documentation and unit tests cover supported path forms and errors.
Exercise configured working directories
test/integration/helpers.ts, test/integration/action.test.ts
Integration helpers preserve cwd and support a separate process directory. Tests cover commits from an absolute working directory and failures for nonexistent directories.

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

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant Action
  participant WorkingDirectory
  participant Git
  Workflow->>Action: Provide cwd input
  Action->>WorkingDirectory: Resolve and validate path
  WorkingDirectory-->>Action: Return valid directory or error
  Action->>Git: Initialize client with directory
  Git-->>Action: Perform commit operation
  Action-->>Workflow: Report result and directory
Loading

Possibly related PRs

🚥 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 identifies the main changes: absolute cwd resolution and prevention of minified bundle dumping.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/9eddbc12

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.

@EndBug
EndBug marked this pull request as ready for review August 14, 2026 20:59
@EndBug EndBug linked an issue Aug 14, 2026 that may be closed by this pull request
@EndBug
EndBug enabled auto-merge (squash) August 14, 2026 21:10
Co-authored-by: Cursor <cursoragent@cursor.com>
@EndBug
EndBug merged commit c5e28a6 into main Aug 14, 2026
9 of 10 checks passed
@EndBug
EndBug deleted the cursor/9eddbc12 branch August 14, 2026 21:11
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.

Currently outputting a bunch of code when this fails...

1 participant