Skip to content

Add selective preload of script modules for Bash and PowerShell#1862

Open
HuyPhanNguyen wants to merge 1 commit intomainfrom
feature/selective-preload-script-modules
Open

Add selective preload of script modules for Bash and PowerShell#1862
HuyPhanNguyen wants to merge 1 commit intomainfrom
feature/selective-preload-script-modules

Conversation

@HuyPhanNguyen
Copy link
Copy Markdown
Contributor

Summary

  • Adds Octopus.Action.Script.PreloadScriptModules variable to control which script modules are auto-imported before a user script runs
  • Bash: selected modules are sourced in the bootstrapper before the user script (previously no auto-sourcing)
  • PowerShell: when variable is set, only listed modules are auto-imported. When unset, existing behavior preserved (all modules imported)
  • Variable supports comma/semicolon delimited lists and can be scoped per step/environment like any Octopus variable

Builds on the concept from #1730 (Bash-only) and extends it to PowerShell with backwards-compatible selective import.

Test plan

  • Bash: single module preload works
  • Bash: multiple modules preload in order
  • Bash: delimiter edge cases (comma, semicolon, spaces, empty entries, missing modules)
  • PowerShell: selected module imports and functions are available
  • PowerShell: unselected modules are not auto-imported
  • PowerShell: no variable set = all modules still auto-imported (existing behavior)

Allow users to control which script modules are auto-imported via
Octopus.Action.Script.PreloadScriptModules variable. Bash gets
selective sourcing before user script. PowerShell switches from
import-all to selective import when variable is set, preserving
existing behavior when unset.
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