From 567fa9e27ab0f96b8144a5d126eb89ae130e18be Mon Sep 17 00:00:00 2001 From: SkyL9ne Date: Fri, 27 Feb 2026 18:39:38 +0200 Subject: [PATCH 1/7] Create Activate.ps1 --- Activate.ps1 | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Activate.ps1 diff --git a/Activate.ps1 b/Activate.ps1 new file mode 100644 index 00000000..bd30e2ee --- /dev/null +++ b/Activate.ps1 @@ -0,0 +1,61 @@ +$script:THIS_PATH = $myinvocation.mycommand.path +$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent + +function global:deactivate([switch] $NonDestructive) { + if (Test-Path variable:_OLD_VIRTUAL_PATH) { + $env:PATH = $variable:_OLD_VIRTUAL_PATH + Remove-Variable "_OLD_VIRTUAL_PATH" -Scope global + } + + if (Test-Path function:_old_virtual_prompt) { + $function:prompt = $function:_old_virtual_prompt + Remove-Item function:\_old_virtual_prompt + } + + if ($env:VIRTUAL_ENV) { + Remove-Item env:VIRTUAL_ENV -ErrorAction SilentlyContinue + } + + if ($env:VIRTUAL_ENV_PROMPT) { + Remove-Item env:VIRTUAL_ENV_PROMPT -ErrorAction SilentlyContinue + } + + if (!$NonDestructive) { + # Self destruct! + Remove-Item function:deactivate + Remove-Item function:pydoc + } +} + +function global:pydoc { + python -m pydoc $args +} + +# unset irrelevant variables +deactivate -nondestructive + +$VIRTUAL_ENV = $BASE_DIR +$env:VIRTUAL_ENV = $VIRTUAL_ENV + +if (__VIRTUAL_PROMPT__ -ne "") { + $env:VIRTUAL_ENV_PROMPT = __VIRTUAL_PROMPT__ +} +else { + $env:VIRTUAL_ENV_PROMPT = $( Split-Path $env:VIRTUAL_ENV -Leaf ) +} + +New-Variable -Scope global -Name _OLD_VIRTUAL_PATH -Value $env:PATH + +$env:PATH = "$env:VIRTUAL_ENV/" + __BIN_NAME__ + __PATH_SEP__ + $env:PATH +if (!$env:VIRTUAL_ENV_DISABLE_PROMPT) { + function global:_old_virtual_prompt { + "" + } + $function:_old_virtual_prompt = $function:prompt + + function global:prompt { + # Add the custom prefix to the existing prompt + $previous_prompt_value = & $function:_old_virtual_prompt + ("(" + $env:VIRTUAL_ENV_PROMPT + ") " + $previous_prompt_value) + } +} From 082b076a39d25fd7d2f28473ec72f487db7acb51 Mon Sep 17 00:00:00 2001 From: SkyL9ne Date: Fri, 27 Feb 2026 19:01:07 +0200 Subject: [PATCH 2/7] Create wingetcreate.ps1 --- .github/workflows/wingetcreate.ps1 | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/wingetcreate.ps1 diff --git a/.github/workflows/wingetcreate.ps1 b/.github/workflows/wingetcreate.ps1 new file mode 100644 index 00000000..d0b9706f --- /dev/null +++ b/.github/workflows/wingetcreate.ps1 @@ -0,0 +1,40 @@ + # Set the package ID based on the release info + $packageId = if ('${{ !github.event.release.prerelease }}' -eq 'true') { 'GitHub.Copilot' } else { 'GitHub.Copilot.Prerelease' } + + # Get installer info from release event + $assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json + $packageVersion = (${{ toJSON(github.event.release.tag_name) }}) + + # Find the download URLs for the x64 and arm64 installers separately + # This allows overrides to be used so that wingetcreate does not have to guess the architecture from the filename + $installerUrlx64 = $assets | Where-Object -Property name -like '*win32-x64.zip' | Select-Object -ExpandProperty browser_download_url + $installerUrlarm64 = $assets | Where-Object -Property name -like '*win32-arm64.zip' | Select-Object -ExpandProperty browser_download_url + + # Update package using wingetcreate + curl.exe -JLO https://aka.ms/wingetcreate/latest + .\wingetcreate.exe update $packageId ` + --version $packageVersion ` + --urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" ` + --out manifests + + # Add PowerShell dependency to installer manifest + $installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName + if (-not $installerManifest) { + Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory." + exit 1 + } + $content = Get-Content -Path $installerManifest -Raw + $dependency = @" + Dependencies: + PackageDependencies: + - PackageIdentifier: Microsoft.PowerShell + MinimumVersion: "7.0.0" + "@ + # 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 + + # Submit the modified manifest + $manifestPath = Split-Path $installerManifest + .\wingetcreate.exe submit $manifestPath \ No newline at end of file From 5d27c89a7f62cd4a0610f84173ca98c177ab90d9 Mon Sep 17 00:00:00 2001 From: SkyL9ne Date: Fri, 27 Feb 2026 19:06:34 +0200 Subject: [PATCH 3/7] Update wingetcreate.ps1 --- .github/workflows/wingetcreate.ps1 | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/wingetcreate.ps1 b/.github/workflows/wingetcreate.ps1 index d0b9706f..4316f257 100644 --- a/.github/workflows/wingetcreate.ps1 +++ b/.github/workflows/wingetcreate.ps1 @@ -1,24 +1,25 @@ - # Set the package ID based on the release info +# Set the package ID based on the release info $packageId = if ('${{ !github.event.release.prerelease }}' -eq 'true') { 'GitHub.Copilot' } else { 'GitHub.Copilot.Prerelease' } - # Get installer info from release event +# Get installer info from release event $assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json $packageVersion = (${{ toJSON(github.event.release.tag_name) }}) - # Find the download URLs for the x64 and arm64 installers separately - # This allows overrides to be used so that wingetcreate does not have to guess the architecture from the filename +# Find the download URLs for the x64 and arm64 installers separately +# This allows overrides to be used so that wingetcreate does not have to guess the architecture from the filename $installerUrlx64 = $assets | Where-Object -Property name -like '*win32-x64.zip' | Select-Object -ExpandProperty browser_download_url $installerUrlarm64 = $assets | Where-Object -Property name -like '*win32-arm64.zip' | Select-Object -ExpandProperty browser_download_url - # Update package using wingetcreate +# Update package using wingetcreate curl.exe -JLO https://aka.ms/wingetcreate/latest .\wingetcreate.exe update $packageId ` --version $packageVersion ` --urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" ` --out manifests - # Add PowerShell dependency to installer manifest - $installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName +# Add PowerShell dependency to installer manifest + +$installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName if (-not $installerManifest) { Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory." exit 1 @@ -30,11 +31,13 @@ - PackageIdentifier: Microsoft.PowerShell MinimumVersion: "7.0.0" "@ - # Remove existing top-level Dependencies block (if any), then insert ours - $content = $content -replace '(?m)^Dependencies:\r?\n([ ]+.+\r?\n)*', '' +# 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 - # Submit the modified manifest - $manifestPath = Split-Path $installerManifest +# Submit the modified manifest + +$manifestPath = Split-Path $installerManifest .\wingetcreate.exe submit $manifestPath \ No newline at end of file From bff4151648512be227e188de7860a014d4bd1a58 Mon Sep 17 00:00:00 2001 From: SkyL9ne Date: Fri, 27 Feb 2026 19:10:08 +0200 Subject: [PATCH 4/7] Update wingetcreate.ps1 --- .github/workflows/wingetcreate.ps1 | 42 ++++++++++++++---------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/wingetcreate.ps1 b/.github/workflows/wingetcreate.ps1 index 4316f257..bf40ffb0 100644 --- a/.github/workflows/wingetcreate.ps1 +++ b/.github/workflows/wingetcreate.ps1 @@ -1,43 +1,41 @@ # Set the package ID based on the release info - $packageId = if ('${{ !github.event.release.prerelease }}' -eq 'true') { 'GitHub.Copilot' } else { 'GitHub.Copilot.Prerelease' } - +$packageId = if ('${{ !github.event.release.prerelease }}' -eq 'true') { 'GitHub.Copilot' } else { 'GitHub.Copilot.Prerelease' } + # Get installer info from release event - $assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json - $packageVersion = (${{ toJSON(github.event.release.tag_name) }}) - +$assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json +$packageVersion = (${{ toJSON(github.event.release.tag_name) }}) + # Find the download URLs for the x64 and arm64 installers separately # This allows overrides to be used so that wingetcreate does not have to guess the architecture from the filename - $installerUrlx64 = $assets | Where-Object -Property name -like '*win32-x64.zip' | Select-Object -ExpandProperty browser_download_url - $installerUrlarm64 = $assets | Where-Object -Property name -like '*win32-arm64.zip' | Select-Object -ExpandProperty browser_download_url - +$installerUrlx64 = $assets | Where-Object -Property name -like '*win32-x64.zip' | Select-Object -ExpandProperty browser_download_url +$installerUrlarm64 = $assets | Where-Object -Property name -like '*win32-arm64.zip' | Select-Object -ExpandProperty browser_download_url + # Update package using wingetcreate - curl.exe -JLO https://aka.ms/wingetcreate/latest - .\wingetcreate.exe update $packageId ` - --version $packageVersion ` - --urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" ` - --out manifests +curl.exe -JLO https://aka.ms/wingetcreate/latest +.\wingetcreate.exe update $packageId ` +--version $packageVersion ` +--urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" ` +--out manifests # Add PowerShell dependency to installer manifest - + $installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName - if (-not $installerManifest) { - Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory." - exit 1 - } - $content = Get-Content -Path $installerManifest -Raw - $dependency = @" +if (-not $installerManifest) { +Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory." +exit 1 +} +$content = Get-Content -Path $installerManifest -Raw +$dependency = @" Dependencies: PackageDependencies: - PackageIdentifier: Microsoft.PowerShell MinimumVersion: "7.0.0" "@ # 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 # Submit the modified manifest - $manifestPath = Split-Path $installerManifest .\wingetcreate.exe submit $manifestPath \ No newline at end of file From 3b378b1dece3cc3545a1b85171e99a4ba753f5f9 Mon Sep 17 00:00:00 2001 From: SkyL9ne Date: Fri, 27 Feb 2026 19:19:22 +0200 Subject: [PATCH 5/7] Update wingetcreate.ps1 --- .github/workflows/wingetcreate.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wingetcreate.ps1 b/.github/workflows/wingetcreate.ps1 index bf40ffb0..429bb1ad 100644 --- a/.github/workflows/wingetcreate.ps1 +++ b/.github/workflows/wingetcreate.ps1 @@ -31,11 +31,17 @@ $dependency = @" - PackageIdentifier: Microsoft.PowerShell MinimumVersion: "7.0.0" "@ + # 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 + +$content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:" + +Set-Content -Path $installerManifest -Value $content # Submit the modified manifest + $manifestPath = Split-Path $installerManifest - .\wingetcreate.exe submit $manifestPath \ No newline at end of file + +.\wingetcreate.exe submit $manifestPath \ No newline at end of file From 2f1901d837b476221d1e4bc8f18f1ea0cad72a3d Mon Sep 17 00:00:00 2001 From: SkyL9ne Date: Fri, 27 Feb 2026 19:20:04 +0200 Subject: [PATCH 6/7] Update wingetcreate.ps1 --- .github/workflows/wingetcreate.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/wingetcreate.ps1 b/.github/workflows/wingetcreate.ps1 index 429bb1ad..412b8c3b 100644 --- a/.github/workflows/wingetcreate.ps1 +++ b/.github/workflows/wingetcreate.ps1 @@ -35,7 +35,6 @@ $dependency = @" # 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 From f79de9544b4f91fb3e70bedff92addd413c475e5 Mon Sep 17 00:00:00 2001 From: SkyL9ne Date: Fri, 27 Feb 2026 19:24:49 +0200 Subject: [PATCH 7/7] Create delete-issues.ps1 --- .github/workflows/delete-issues.ps1 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/delete-issues.ps1 diff --git a/.github/workflows/delete-issues.ps1 b/.github/workflows/delete-issues.ps1 new file mode 100644 index 00000000..5ad1ac41 --- /dev/null +++ b/.github/workflows/delete-issues.ps1 @@ -0,0 +1,24 @@ +const issueTitle = context.payload.issue.title.trim(); +const isSingleWord = /^\S+$/.test(issueTitle); + +if (isSingleWord) { +const issueNumber = context.payload.issue.number; +const repo = context.repo.repo; + +// Close the issue and add the invalid label +github.rest.issues.update({ +owner: context.repo.owner, +repo: repo, +issue_number: issueNumber, +labels: ['invalid'], +state: 'closed' +}); + +// Comment on the issue +await github.rest.issues.createComment({ +owner: context.repo.owner, +repo: repo, +issue_number: issueNumber, +body: `This issue may have been opened accidentally. I'm going to close it now, but feel free to open a new issue with a more descriptive title.` +}); +} \ No newline at end of file