📖 [Docs]: Name GitHub Action helper modules after the action#25
Open
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Open
📖 [Docs]: Name GitHub Action helper modules after the action#25Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Conversation
Bundled helper modules named generically (Helpers) collide with shared or sibling modules in the runner's single module session, breaking module resolution and Mock -ModuleName. Require action-scoped names (action-name.Helpers). Declares the standard from issue #24.
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.
Declares the standard from #24: a helper module bundled inside a GitHub Action is named after the action (
<action-name>.Helpers), never a generic name likeHelpers.Why
Every module imported during a job shares one session on the runner. A generically named module (
Helpers,Utils,Common) collides with a shared module of the same name (an ecosystem often installs a shared helper module that actions import by name) or with another action's helper loaded in the same job. Once two loaded modules share a name, module resolution is ambiguous and unit tests that mock a command inside the module by module name fail. Real example: PSModule/Resolve-PSModuleVersion#4.Changes
Coding-Standards/GitHub-Actions.md— new "Name helper modules after the action" subsection under "Extract non-trivialrun:scripts into an action" (rule, rationale, and the shared-module carve-out).Coding-Standards/PowerShell/Scripts.md— cross-reference bullet in Rules.Validation
markdownlint, textlint terminology, codespell, link check, and index-drift check all pass locally.
Closes #24. Ecosystem rollout across PSModule actions is tracked in PSModule/Process-PSModule#364.