-
Notifications
You must be signed in to change notification settings - Fork 0
🚀 [Feature]: Separate cleanup from release type and move ReleaseType to Publish.Module #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ptions in schema and related scripts
AutoCleanup to CleanupPrereleases and separate cleanup from release type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the prerelease cleanup mechanism by renaming AutoCleanup to CleanupPrereleases and separating the cleanup decision from the ReleaseType enum. The cleanup logic is now computed independently based on the PR state and user preferences, making the behavior more explicit and easier to understand.
Changes:
- Renamed
Publish.Module.AutoCleanuptoPublish.Module.CleanupPrereleasesfor clarity - Removed
Cleanupfrom theReleaseTypeenum (now onlyRelease,Prerelease, orNone) - Moved
ReleaseTypeand the computedCleanupPrereleasesvalue toPublish.Modulesection instead ofRun
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/scenarios/valid/PSModule.yml | Updated test configuration to use new Publish.Module.CleanupPrereleases structure |
| tests/scenarios/invalid-percent-target/PSModule.yml | Updated test configuration to use new Publish.Module.CleanupPrereleases structure |
| scripts/main.ps1 | Implemented the core refactoring: renamed setting, separated cleanup logic from ReleaseType, and added computed values to Publish.Module |
| scripts/Settings.schema.json | Updated schema to rename AutoCleanup to CleanupPrereleases, improved description, and removed 'Cleanup' from ReleaseType enum |
Comments suppressed due to low confidence (1)
scripts/Settings.schema.json:181
- The schema is missing the
ReleaseTypeproperty definition in thePublish.Modulesection. According to the PR description and the code changes inscripts/main.ps1(line 433),ReleaseTypeis now being added as a computed property toPublish.Module. The schema should include aReleaseTypeproperty here with the same structure as defined in theRunsection (type: string, enum: ["Release", "Prerelease", "None"]).
"properties": {
"Skip": {
"type": "boolean",
"description": "Skip module publish"
},
"CleanupPrereleases": {
"type": "boolean",
"description": "When enabled (default: true), automatically cleans up old prerelease tags when merging to main or when a PR is abandoned"
},
"AutoPatching": {
"type": "boolean",
"description": "Automatically apply patches"
},
"IncrementalPrerelease": {
"type": "boolean",
"description": "Use incremental prerelease versioning"
},
"DatePrereleaseFormat": {
"type": "string",
"description": "Date format for prerelease versions"
},
"VersionPrefix": {
"type": "string",
"description": "Prefix for version tags"
},
"MajorLabels": {
"type": "string",
"description": "Comma-separated labels that trigger major version bump"
},
"MinorLabels": {
"type": "string",
"description": "Comma-separated labels that trigger minor version bump"
},
"PatchLabels": {
"type": "string",
"description": "Comma-separated labels that trigger patch version bump"
},
"IgnoreLabels": {
"type": "string",
"description": "Comma-separated labels that prevent release"
},
"PrereleaseLabels": {
"type": "string",
"description": "Comma-separated labels that trigger a prerelease"
},
"UsePRTitleAsReleaseName": {
"type": "boolean",
"description": "Use pull request title as the GitHub release name"
},
"UsePRBodyAsReleaseNotes": {
"type": "boolean",
"description": "Use pull request body as the release notes content"
},
"UsePRTitleAsNotesHeading": {
"type": "boolean",
"description": "Add pull request title as H1 heading in release notes"
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…licate definition
…d logic in settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AutoCleanup to CleanupPrereleases and separate cleanup from release typeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The release type calculation is now separated from cleanup logic, providing clearer control over when prereleases are cleaned up. The
ReleaseTypenow only has three values (Release,Prerelease, orNone), and cleanup is computed independently based on theAutoCleanupsetting.ReleaseType simplified to three values
Previously,
ReleaseTypecould be set toCleanupto trigger prerelease cleanup. Now,ReleaseTypeonly has three values:Release,Prerelease, orNone. The cleanup decision is computed separately based on:AutoCleanupis enabled in your settings (defaults totrue)This separation enables the abandoned PR cleanup scenario where a PR is closed without merging—the workflow can now trigger cleanup independently of whether a release is being created.
ReleaseType moved to Publish.Module output
The computed
ReleaseTypevalue is now stored inPublish.Module.ReleaseTyperather than in theRunobject. This organizes release-related computed values alongside other publish settings.Workflows should now reference:
fromJson(inputs.Settings).Publish.Module.ReleaseTypefor the release typefromJson(inputs.Settings).Publish.Module.AutoCleanupfor the cleanup decision (computed boolean)AutoCleanup behavior
The
AutoCleanupsetting continues to work as before, but the output value is now a computed boolean that indicates whether cleanup should actually occur (based on both the setting and the current context like merged PR or abandoned PR).