Skip to content

Refactor version resolution logic into helper functions#2

Draft
Marius Storhaug (MariusStorhaug) wants to merge 10 commits into
mainfrom
funcs
Draft

Refactor version resolution logic into helper functions#2
Marius Storhaug (MariusStorhaug) wants to merge 10 commits into
mainfrom
funcs

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

Summary

Refactor the action script by moving the version resolution workflow out of scripts/main.ps1 and into a dedicated scripts/Helpers.psm1 module.

This keeps main.ps1 as a thin orchestrator and makes the individual steps easier to read, compare, and validate.

Changes

  • extract action input parsing into Read-ActionInput
  • extract publish settings parsing into Get-PublishConfiguration
  • extract pull request event loading into Get-GitHubPullRequest
  • extract release decision logic into Resolve-ReleaseDecision
  • extract GitHub and PowerShell Gallery version lookups into dedicated helpers
  • extract next-version calculation and action output writing into dedicated helpers
  • update scripts/main.ps1 to orchestrate the helper calls

Notes

  • Intended behavior is unchanged for the normal release/version resolution path.
  • Error handling now throws from helper functions instead of using inline Write-Error/exit in main.ps1.

Validation

  • verified the refactor against main with git diff --function-context
  • verified both edited PowerShell files report no editor errors locally

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