Skip to content

Conversation

@ConradIrwin
Copy link

@ConradIrwin ConradIrwin commented Oct 27, 2025

We're trying to use gh-workflow at Zed (https://github.com/zed-industries/zed) and needed this.

Summary by CodeRabbit

  • New Features
    • Added support for specifying a shell option in workflow steps. Users can now optionally define which shell to use for step execution.

@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Walkthrough

A new optional shell field was added to the StepValue struct in the GitHub workflow module. The field includes serde attributes to skip serialization when unset, allowing workflow steps to specify which shell to use during execution.

Changes

Cohort / File(s) Change Summary
StepValue field addition
crates/gh-workflow/src/step.rs
Added pub shell: Option<String> field to StepValue struct with serde skip_serializing_if attribute and documentation comment

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single, straightforward field addition following established patterns
  • Serde attributes properly configured for optional serialization
  • No logic changes or complex interactions

Poem

🐰 A shell of a field, so neat and so fine,
Added with care, in perfect align—
Skip when it's empty, include when it's there,
Workflow steps now execute with flair! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Add Step::shell" directly and clearly corresponds to the main change in the pull request: adding a new optional shell: Option<String> field to the StepValue struct. The title uses specific Rust naming conventions that accurately describe the feature being added, making it immediately understandable to teammates reviewing the git history. The title is concise, avoids vague terms or noise, and conveys the primary change without needing to cover every detail of the implementation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/gh-workflow/src/step.rs (1)

137-139: Consider improving the documentation comment.

The comment "Shell to run with" could be more descriptive and consistent with the documentation style used for other fields in this struct. For example, other fields use complete sentences like "The command to run in the step."

Consider updating the documentation to be more descriptive:

-    /// Shell to run with
+    /// The shell to use when running the command.
     #[serde(skip_serializing_if = "Option::is_none")]
     pub shell: Option<String>,

Alternatively, you could add more context about valid values:

-    /// Shell to run with
+    /// The shell to use when running the command (e.g., "bash", "pwsh", "sh").
     #[serde(skip_serializing_if = "Option::is_none")]
     pub shell: Option<String>,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ec2428 and 6171308.

📒 Files selected for processing (1)
  • crates/gh-workflow/src/step.rs (1 hunks)
🔇 Additional comments (1)
crates/gh-workflow/src/step.rs (1)

137-140: Implementation looks good.

The shell field is correctly implemented:

  • Follows the same pattern as other optional fields in StepValue
  • Uses appropriate serde attributes to skip serialization when None
  • Positioned logically after the run field
  • Will have a setter generated by derive_setters, making it easy for users to configure

This mirrors GitHub Actions' native shell field and will allow users to specify custom shells for their workflow steps.

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.

1 participant