Skip to content

Refactor version resolution logic into helper functions#2

Merged
Marius Storhaug (MariusStorhaug) merged 10 commits into
mainfrom
funcs
May 24, 2026
Merged

Refactor version resolution logic into helper functions#2
Marius Storhaug (MariusStorhaug) merged 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

@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review May 24, 2026 10:06
Copilot AI review requested due to automatic review settings May 24, 2026 10:06
@MariusStorhaug Marius Storhaug (MariusStorhaug) merged commit 65b7cb0 into main May 24, 2026
29 of 31 checks passed
@MariusStorhaug Marius Storhaug (MariusStorhaug) review requested due to automatic review settings May 24, 2026 10: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.

1 participant