🩹 [Patch]: Setup/teardown jobs no longer waste runner time when scripts are absent#300
Merged
Marius Storhaug (MariusStorhaug) merged 1 commit intomainfrom Mar 27, 2026
Conversation
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
1 similar comment
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
4343d76
into
main
50 of 51 checks passed
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
March 27, 2026 22:32
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Get-Settings reusable workflow to use the newer PSModule/Get-PSModuleSettings action version so setup/teardown job run flags can be evaluated earlier (avoiding runner allocation when scripts are absent).
Changes:
- Bump
PSModule/Get-PSModuleSettingsfrom v1.4.3 to v1.4.4 by updating the pinned commit SHA inGet-Settings.yml.
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.
The
BeforeAll-ModuleLocalandAfterAll-ModuleLocalworkflow jobs no longer allocate runners when the correspondingtests/BeforeAll.ps1ortests/AfterAll.ps1scripts do not exist in the repository. Repositories without setup/teardown scripts now skip these jobs entirely, saving runner time on every workflow run.Changed: Runner allocation for setup/teardown jobs
With the
Get-PSModuleSettingsv1.4.4 update, repositories withouttests/BeforeAll.ps1ortests/AfterAll.ps1no longer allocate runners for theBeforeAll-ModuleLocalandAfterAll-ModuleLocaljobs. These jobs are now skipped entirely at the settings evaluation stage, before any runner is provisioned.Previously, both jobs always spun up a runner — even when there was nothing to execute. The runner would check out the repo, invoke the GitHub-Script action, find no script, and exit gracefully. This wasted runner time on every workflow run for the majority of repositories.
Additionally,
AfterAllModuleLocalwas previously set to$trueunconditionally. It now uses the same base conditions asBeforeAllModuleLocalcombined with the script existence check. The workflow-levelalways()condition remains as an additional safeguard for cleanup-after-failure scenarios.Technical Details
PSModule/Get-PSModuleSettingsfromv1.4.3(3d53e12) tov1.4.4(21c88f4) inGet-Settings.yml.Test-Pathchecks for the setup/teardown scripts and sets theRun.BeforeAllModuleLocal/Run.AfterAllModuleLocalflags accordingly, which the existing workflowif:conditions already respect.