Control the shell for run steps via DefaultShell - #430
Conversation
ChrisonSimtian
left a comment
There was a problem hiding this comment.
lgtm, thanks for filling in the gaps with gh actions :-)
Glad to:) |
b4485fd to
65c7381
Compare
|
@avidenic can you rebase and let me know if it lets you merge? You got all the green ticks you need now and you're a contributor, so gh should let you merge by yourself now ;-) |
Cross-platform matrix jobs silently use a different default shell per OS (bash on Linux/macOS, pwsh on Windows), which changes script semantics. The generator had no way to emit an explicit shell. Add a public string DefaultShell to GitHubActionsAttribute. When set, the workflow emits a top-level defaults.run.shell block (after concurrency, before jobs), pinning one shell for every run: step across all matrix jobs. Free-string value; unset or whitespace-only emits no block. Per-step shell was deliberately scoped out (one run step per job; no granularity gain). Covered by two Verify snapshot cases (default-shell, and a default-shell-with-permissions ordering guard).
ab5b963 to
fe6f696
Compare
|
@ChrisonSimtian hey - I squashed and rebased, no option to merge though. |
|
@avidenic my apologies, I thought I already gave you write access, should work now :-) |
|
@ChrisonSimtian I think GH does not like us today:
|
It'll work once you've accepted the invite :-)
|
|
@ChrisonSimtian sorry, about that. Got buried in the notifications. Tnx for being patient with me - I am usually on the other side where I give out permissions :D |


Closes #388.
Adds
DefaultShelltoGitHubActionsAttribute. When set, the workflow emits a top-leveldefaults.run.shellblock so cross-platform matrix jobs pin one shell instead of the per-OS default (bashon Linux/macOS,pwshon Windows).concurrency:, beforejobs:; unset or whitespace-only emits nothing.command {0}template) — raw-interpolated, consistent with the siblingEnv/ConcurrencyGroupvalues.run:lines (tool restore +dotnet fallout) across every matrix job.Scoped out — per-step
shell:. The issue proposed it as a secondary escape hatch; analysis dropped it.GetStepsis private and emits exactly one run step per job, so a per-stepShellfield has no granularity advantage over the workflow default and no reachable setter. Clean additive follow-up if a real extension scenario needs it.Tests — two Verify snapshot cases:
default-shell(emission) anddefault-shell-with-permissions(placement guard vspermissions:/concurrency:). No dedicated whitespace test: the guard delegates to the BCL primitive, and the repo reserves*ValidationTest.csfor features that throw.