Skip to content

Include PowerShell dependency in winget manifest (v3)#1557

Merged
SteveSandersonMS merged 2 commits intomainfrom
stevesa/powershell-dependency-v3
Feb 20, 2026
Merged

Include PowerShell dependency in winget manifest (v3)#1557
SteveSandersonMS merged 2 commits intomainfrom
stevesa/powershell-dependency-v3

Conversation

@SteveSandersonMS
Copy link
Copy Markdown
Contributor

@SteveSandersonMS SteveSandersonMS commented Feb 20, 2026

Fixes two issues in the previous iteration:

  • Passes the correct directory path to wingetcreate.exe submit, fixing the Subdirectory not supported in manifest path error
  • Handles the situation where a prior version of the manifest already declares the dependency. It now overwrites any existing list of dependencies using the information from our workflow here, so this workflow is the source of truth

This time I actually ran the logic manually even to the point of letting it submit a PR which I then closed.

SteveSandersonMS and others added 2 commits February 20, 2026 09:49
Re-applies the change from PR #1497 which was reverted in PR #1548.

The original broke the workflow YAML because the PowerShell here-string
content and closing tag had zero indentation, which terminated the YAML
literal block scalar (run: |). Fixed by indenting the here-string body
to match the block indentation level; YAML strips the leading spaces,
leaving valid PowerShell with the closing tag at column 0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 20, 2026 10:22
@SteveSandersonMS SteveSandersonMS changed the title Fix winget workflow to avoid duplicating dependencies Include PowerShell dependency in winget manifest (v3) Feb 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the WinGet release submission workflow to avoid duplicating Dependencies: entries in generated installer manifests by normalizing/removing any existing block before injecting the required PowerShell dependency, then submitting the modified manifests.

Changes:

  • Switch from wingetcreate update --submit to wingetcreate update --out manifests followed by an explicit wingetcreate submit.
  • Add a PowerShell step to locate the generated *.installer.yaml, remove any existing top-level Dependencies: block, and insert a PowerShell dependency before Installers:.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Remove existing top-level Dependencies block (if any), then insert ours
$content = $content -replace '(?m)^Dependencies:\r?\n([ ]+.+\r?\n)*', ''
$content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:"
Set-Content -Path $installerManifest -Value $content
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set-Content is called without an explicit encoding. PowerShell’s default encoding differs between hosts/versions, which can produce manifests in an unexpected encoding and potentially break submission tooling. Consider setting -Encoding utf8 (and, if needed, preserving the original line endings).

Suggested change
Set-Content -Path $installerManifest -Value $content
Set-Content -Path $installerManifest -Value $content -Encoding utf8

Copilot uses AI. Check for mistakes.
@SteveSandersonMS SteveSandersonMS merged commit 906ad6f into main Feb 20, 2026
7 checks passed
@SteveSandersonMS SteveSandersonMS deleted the stevesa/powershell-dependency-v3 branch February 20, 2026 14:58
Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun

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.

3 participants