Skip to content

Update template --allow-scripts help text with explicit trust warning and propagate localization source updates - #54393

Merged
marcpopMSFT merged 5 commits into
release/10.0.4xxfrom
copilot/update-allow-scripts-message
Jun 10, 2026
Merged

marcpopMSFT merged 5 commits into
release/10.0.4xxfrom
copilot/update-allow-scripts-message

Conversation

Copilot AI commented May 20, 2026

Copy link
Copy Markdown
Contributor

This updates the TemplateCommand_Option_AllowScripts message in SymbolStrings.resx to include a clear security warning about arbitrary code execution via MSBuild. The localization source strings are regenerated so translation files track the new English source and require translation review.

  • Resource text update

    • Replaced the --allow-scripts description in:
      • src/Cli/Microsoft.TemplateEngine.Cli/Commands/SymbolStrings.resx
    • New text makes explicit that disabling this option does not eliminate arbitrary code execution risk from templates.
  • Localization propagation

    • Regenerated SymbolStrings.*.xlf under:
      • src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/
    • Updated <source> for TemplateCommand_Option_AllowScripts across locales.
    • Marked existing translations as needs-review-translation for this key.
<data name="TemplateCommand_Option_AllowScripts" xml:space="preserve">
  <value>Specifies if post action scripts should run. Templates can run arbitrary code through MSBuild whether or not this option is enabled; only use templates from trusted sources.</value>
</data>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the dotnet new template --allow-scripts option description to include an explicit security warning about arbitrary code execution via MSBuild, and propagates the updated English source string across localization files so translations are flagged for review.

Changes:

  • Expanded TemplateCommand_Option_AllowScripts help text in SymbolStrings.resx with an explicit trust warning.
  • Regenerated SymbolStrings.*.xlf so the updated <source> is reflected across locales.
  • Marked existing translations for the updated key as needs-review-translation.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Cli/Microsoft.TemplateEngine.Cli/Commands/SymbolStrings.resx Updates the English help text for --allow-scripts with an explicit security warning.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.cs.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.de.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.es.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.fr.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.it.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.ja.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.ko.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.pl.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.pt-BR.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.ru.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.tr.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.zh-Hans.xlf Updates localization source string and marks translation as needing review.
src/Cli/Microsoft.TemplateEngine.Cli/Commands/xlf/SymbolStrings.zh-Hant.xlf Updates localization source string and marks translation as needing review.

@marcpopMSFT

Copy link
Copy Markdown
Member

@copilot Update DotnetNewHelpTests.CanShowAllowScriptsOption.verified.txt for the new string to fix the tests.

Copilot AI requested a review from a team as a code owner May 27, 2026 18:32

Copilot AI commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Update DotnetNewHelpTests.CanShowAllowScriptsOption.verified.txt for the new string to fix the tests.

Updated DotnetNewHelpTests.CanShowAllowScriptsOption.verified.txt to the new output and validated with the filtered test (CanShowAllowScriptsOption) passing. Addressed in commit a322060.

Copilot AI requested a review from marcpopMSFT May 27, 2026 18:34
@marcpopMSFT
marcpopMSFT force-pushed the copilot/update-allow-scripts-message branch from 298323a to 1e0e799 Compare June 8, 2026 21:02
@marcpopMSFT
marcpopMSFT enabled auto-merge (squash) June 10, 2026 20:14
--no-update-check Disables checking for the template package updates when instantiating a template. [default: False]
--project <project> The project that should be used for context evaluation.
--allow-scripts <No|Prompt|Yes> Specifies if post action scripts should run. [default: Prompt]
--allow-scripts <No|Prompt|Yes> Specifies if post action scripts should run. Templates can run arbitrary code through MSBuild whether or not this option is enabled; only use templates from trusted sources. [default: Prompt]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit - it might be more precise to use regardless of this setting instead of whether or not this option is enabled as this isn't a boolean-type option.

@marcpopMSFT
marcpopMSFT merged commit 81b51ed into release/10.0.4xx Jun 10, 2026
28 checks passed
@marcpopMSFT
marcpopMSFT deleted the copilot/update-allow-scripts-message branch June 10, 2026 22:29
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.

4 participants