-
Notifications
You must be signed in to change notification settings - Fork 0
🚀 [Feature]: Add ReleaseType input for explicit release control #59
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
base: main
Are you sure you want to change the base?
Changes from all commits
68919b7
2f56a03
9d1cc76
d405e6b
8f40324
958ddab
b6b4e9c
6dc9cd1
f5e1a40
de0ed31
19f2e0a
ad87f5e
36cbceb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,6 +49,10 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: A comma separated list of labels that do not trigger a release. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: NoRelease | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ReleaseType: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: The type of release to create. Values are 'Release' (stable), 'Prerelease', or 'None'. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: Release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WhatIf: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: If specified, the action will only log the changes it would make, but will not actually create or delete any releases or tags. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -76,24 +80,55 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install-PSModuleHelpers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: PSModule/Install-PSModuleHelpers@d60d63e4be477d1ca0c67c6085101fb109bce8f1 # v1.0.6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run Publish-PSModule | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Update Microsoft.PowerShell.PSResourceGet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Install-PSResource -Name Microsoft.PowerShell.PSResourceGet -Repository PSGallery -TrustRepository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Initialize Publish Context | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: init | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ inputs.WorkingDirectory }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_Name: ${{ inputs.Name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_ModulePath: ${{ inputs.ModulePath }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_APIKey: ${{ inputs.APIKey }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_AutoCleanup: ${{ inputs.AutoCleanup }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_AutoPatching: ${{ inputs.AutoPatching }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_DatePrereleaseFormat: ${{ inputs.DatePrereleaseFormat }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_IgnoreLabels: ${{ inputs.IgnoreLabels }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_ReleaseType: ${{ inputs.ReleaseType }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_IncrementalPrerelease: ${{ inputs.IncrementalPrerelease }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_MajorLabels: ${{ inputs.MajorLabels }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_MinorLabels: ${{ inputs.MinorLabels }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_PatchLabels: ${{ inputs.PatchLabels }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: ${{ github.action_path }}/scripts/init.ps1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Code injection Medium
Potential code injection in
${ github.action_path } Error loading related location Loading
Copilot AutofixAI about 2 hours ago To fix the issue, avoid expanding Concretely, in the “Initialize Publish Context” step (lines 88–105), we will:
This keeps existing functionality (we still run the same script in the same directory), but removes the expression from the
Suggested changeset
1
action.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download module artifact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: env.PUBLISH_CONTEXT_ShouldPublish == 'true' || inputs.WhatIf == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: ${{ inputs.ModulePath }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+107
to
+112
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Publish Module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: env.PUBLISH_CONTEXT_ShouldPublish == 'true' || inputs.WhatIf == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ inputs.WorkingDirectory }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_Name: ${{ inputs.Name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_ModulePath: ${{ inputs.ModulePath }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_APIKey: ${{ inputs.APIKey }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRBodyAsReleaseNotes: ${{ inputs.UsePRBodyAsReleaseNotes }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsReleaseName: ${{ inputs.UsePRTitleAsReleaseName }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsNotesHeading: ${{ inputs.UsePRTitleAsNotesHeading }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: ${{ github.action_path }}/scripts/main.ps1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: ${{ github.action_path }}/scripts/publish.ps1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Code injection Medium
Potential code injection in
${ github.action_path } Error loading related location Loading Copilot AutofixAI about 2 hours ago Copilot could not generate an autofix suggestion Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cleanup Prereleases | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: env.PUBLISH_CONTEXT_ShouldCleanup == 'true' || inputs.WhatIf == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ inputs.WorkingDirectory }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: ${{ github.action_path }}/scripts/cleanup.ps1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Code injection Medium
Potential code injection in
${ github.action_path } Error loading related location Loading
Copilot AutofixAI about 2 hours ago In general, to fix this class of problem in GitHub Actions, avoid using For this specific case in Concretely:
PowerShell will expand
Suggested changeset
1
action.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,49 @@ | ||||||
| [CmdletBinding()] | ||||||
| param() | ||||||
|
|
||||||
| #region Load context from environment | ||||||
| $prereleaseName = $env:PUBLISH_CONTEXT_PrereleaseName | ||||||
| $prereleaseTagsToCleanup = $env:PUBLISH_CONTEXT_PrereleaseTagsToCleanup | ||||||
| $whatIf = $env:PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf -eq 'true' | ||||||
|
|
||||||
| if ([string]::IsNullOrWhiteSpace($prereleaseName)) { | ||||||
| Write-Error 'PUBLISH_CONTEXT_PrereleaseName is not set. Run main.ps1 first.' | ||||||
|
||||||
| Write-Error 'PUBLISH_CONTEXT_PrereleaseName is not set. Run main.ps1 first.' | |
| Write-Error 'PUBLISH_CONTEXT_PrereleaseName is not set. Run init.ps1 first.' |
Uh oh!
There was an error while loading. Please reload this page.