[GitHubActions] generator: control the shell for run steps via DefaultShell#430
Open
avidenic wants to merge 1 commit into
Open
[GitHubActions] generator: control the shell for run steps via DefaultShell#430avidenic wants to merge 1 commit into
avidenic wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Testis green.Packcurrently fails onmainbecauseCHANGELOG.mdwas deleted (c2cdf60) whileIPack/IHasChangelogstill requires it — unrelated to this PR, fixed separately.