Convert .ci build/test pipelines from Azure DevOps to GitHub Actions - #2018
Open
adityapatwardhan wants to merge 5 commits into
Open
Convert .ci build/test pipelines from Azure DevOps to GitHub Actions#2018adityapatwardhan wants to merge 5 commits into
adityapatwardhan wants to merge 5 commits into
Conversation
Adds a PowerShell-based migration tool that scans .ps1/.psm1/.psd1 files for PowerShellGet v2 cmdlet usage and converts them to PSResourceGet equivalents using AST-based parsing. Features: - 25 cmdlet mappings (Find-Module → Find-PSResource, etc.) - Parameter transformations (version ranges, renames, removals) - Dry-run report mode and in-place apply with backups - 30 Pester tests covering all conversion scenarios Co-authored-by: Copilot App <[email protected]>
Adds ConvertTo-PSResourceGetString function and -InputScript parameter to the entry-point script, enabling direct string-to-string conversion without needing files on disk. Usage: .\ConvertTo-PSResourceGet.ps1 -InputScript 'Install-Module -Name Pester' 'Find-Module -Name Az' | .\ConvertTo-PSResourceGet.ps1 Co-authored-by: Copilot App <[email protected]>
Merge PSGetMigration.psm1/psd1 module into ConvertTo-PSResourceGet.ps1 as a self-contained script. All functions are defined inline and the main entry point is guarded so dot-sourcing for tests works correctly. Removes: PSGetMigration.psm1, PSGetMigration.psd1 Co-authored-by: Copilot App <[email protected]>
When -MinimumVersion or -MaximumVersion contains a variable reference (e.g. \), use double quotes for the version range string so the variable expands at runtime. Literal version strings continue to use single quotes. Before: -Version '(,\]' (broken - no expansion) After: -Version "(,\]" (correct - variable expands) Co-authored-by: Copilot App <[email protected]>
Adds GitHub Actions equivalents for the portable CI + test pipelines: - .github/workflows/psresourceget-ci.yml (from .ci/ci.yml build + test stages) - .github/workflows/psresourceget-test.yml (reusable, from .ci/test.yml) Azure-authenticated test steps use azure/login OIDC (federated credentials). Signing, compliance, release and symbol stages are intentionally not converted (Microsoft-internal ESRP / 1ES / ComplianceRepo / symbol server). Original .ci files are kept unchanged. Co-authored-by: Copilot <[email protected]> Copilot-Session: ceb1570e-c42e-4363-8f8e-5abc7f750458
adityapatwardhan
requested review from
SydneyhSmith,
alerickson,
anamnavi and
shammu1
as code owners
August 4, 2026 21:39
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR migrates the repo’s portable CI/test pipelines from Azure DevOps (.ci/) to GitHub Actions by introducing a Windows build workflow that publishes artifacts and a reusable, cross-platform test workflow. It also adds a PSGet→PSResourceGet script migration tool (with docs and tests), which is additional scope beyond the PR’s stated CI-conversion focus.
Changes:
- Add
PSResourceGet-CIGitHub Actions workflow to build the module on Windows and upload artifacts. - Add reusable
PSResourceGet-Testworkflow (workflow_call) to run the existing cross-platform functional test logic. - Add a PSGet→PSResourceGet migration utility script under
tool/migration/with a README and Pester tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/psresourceget-ci.yml |
New CI workflow to build/package on Windows and fan out to the reusable test workflow. |
.github/workflows/psresourceget-test.yml |
New reusable test workflow implementing the cross-platform functional test logic and Azure auth flow. |
tool/migration/ConvertTo-PSResourceGet.ps1 |
New AST-based converter script for migrating PSGet v2 cmdlets/parameters to PSResourceGet equivalents. |
tool/migration/README.md |
Documentation for the migration tool, usage patterns, and mapping tables. |
tool/migration/Tests/PSGetMigration.Tests.ps1 |
Pester coverage for the converter mappings and conversion behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Many pwsh snippets below were carried over verbatim from the Azure DevOps template, | ||
| # which relied on $(Agent.TempDirectory). Map it to the runner temp directory so the | ||
| # scripts keep working unchanged across all subsequent steps. | ||
| "AGENT_TEMPDIRECTORY=$env:RUNNER_TEMP" | Out-File -FilePath $env:GITHUB_ENV -Append |
Comment on lines
+186
to
+188
| if ($parseErrors.Count -gt 0) { | ||
| Write-Warning "Parse errors in '$Path': $($parseErrors | ForEach-Object { $_.Message } | Join-String -Separator '; ')" | ||
| } |
| ## Using as a Module | ||
|
|
||
| ```powershell | ||
| Import-Module .\tool\migration\PSGetMigration.psd1 |
Comment on lines
+1
to
+5
| # PSGet → PSResourceGet Migration Tool | ||
|
|
||
| A PowerShell-based tool to automatically migrate scripts from PowerShellGet v2 (PSGet) | ||
| cmdlets to their [PSResourceGet](https://github.com/PowerShell/PSResourceGet) equivalents. | ||
|
|
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.
Summary
Converts the portable CI + test Azure DevOps pipelines under
.ci/to GitHub Actions. Original.cifiles are left in place (no deletions)..github/workflows/psresourceget-ci.yml.ci/ci.yml(Build + Test stages).nupkgonwindows-latest, uploads artifacts, then fans out to the test workflow.github/workflows/psresourceget-test.yml.ci/test.yml(reusable template)workflow_call) cross-platform test jobTest matrix (mirrors ci.yml)
useAzAuth: true)Key mapping decisions
push+pull_requestonmaster.AzurePowerShell@5/NuGetAuthenticate@1->azure/login@v2+azure/powershell@v2using OIDC / federated credentials (recommended - no long-lived secrets).artifact.upload/DownloadBuildArtifacts->actions/upload-artifact@v4/actions/download-artifact@v4.$(Agent.TempDirectory)->AGENT_TEMPDIRECTORYenv set from$RUNNER_TEMPso carried-over scripts run unchanged.Intentionally NOT converted
Signing (ESRP), Compliance (ComplianceRepo templates), Release, and Publish-Symbols stages rely on Microsoft-internal infrastructure (ESRP, 1ES secure pools, Microsoft symbol server, ADO artifact feeds) with no GitHub-hosted equivalent.
ci_auto.yml,ci_release.yml,release.yml,publishsymbols.ymlare unchanged.Validation
actionlint(exit 0) and YAML parse checks.Required GitHub.com settings (repo Settings)
These must be configured for the Azure-authenticated / functional test jobs to succeed:
1. Azure OIDC federated credentials - create an App Registration / Managed Identity federated to this repo (subject
repo:PowerShell/PSResourceGet:ref:refs/heads/masterand the pull_request subject), grant it access to thePSResourceGetACRsubscription /psresourcegettestACR. Then add repository secrets:AZURE_CLIENT_IDAZURE_TENANT_IDAZURE_SUBSCRIPTION_ID2. Test PAT secrets (from the ADO
GithubTestingFeedCredsvariable group):GITHUB_PATADO_PUBLIC_PATADO_PRIVATE_PATADO_PRIVATE_REPO_URL3. Actions permissions: Settings -> Actions -> General -> allow workflows to run. Workflows only need
contents: read+id-token: write(already declared).4. (Optional) Branch protection: add the new checks (e.g. PowerShell Core on Windows, PowerShell Core on Ubuntu, etc.) as required status checks once a run has reported them.