Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 16, 2025

  • Analyze the Azure DevOps Linux packaging pipeline structure
  • Review the existing linux-packaging composite action
  • Update the linux-packaging composite action to properly work with GitHub Actions
    • Fixed artifact download to use specific artifact name
    • Replaced JavaScript extraction with PowerShell Expand-Archive
    • Set BUILD_ARTIFACTSTAGINGDIRECTORY environment variable
    • Replaced Azure DevOps artifact upload with GitHub Actions upload-artifact
    • Added .NET setup step
    • Updated paths to use runner.workspace instead of github.workspace
    • Cleaned up trailing spaces
  • Enable Linux packaging job in linux-ci.yml workflow
    • Uncommented the linux_packaging job
    • Added dependency on changes job for path filtering
    • Updated to use ubuntu-latest runner
    • Added linux_packaging to ready_to_merge dependencies
  • Validate YAML syntax and structure
    • Both YAML files are syntactically valid
    • No documentation updates needed
  • Fix gem permission error in Install-GlobalGem function
    • Updated Install-GlobalGem to detect GitHub Actions environment (GITHUB_ACTIONS env var)
    • Now uses sudo for gem install in GitHub Actions, just like Azure DevOps (TF_BUILD)
  • Fix git describe error for packaging
    • Changed checkout fetch-depth from 1000 to 0 for full git history
    • Added Sync-PSTags -AddRemoteIfMissing call to ensure tags are available
    • This resolves the "git describe --abbrev=60 --long" error during packaging
  • Complete conversion with minimal changes
    • 3 files modified
    • All packaging requirements met

Summary

Successfully converted the Azure DevOps Linux Packaging pipeline to a GitHub Actions workflow by:

  1. Updating the composite action at .github/actions/test/linux-packaging/action.yml to use GitHub Actions equivalents for all Azure DevOps-specific tasks
  2. Enabling the linux_packaging job in .github/workflows/linux-ci.yml
  3. Fixing the gem permission error by updating Install-GlobalGem in build.psm1 to detect GitHub Actions environment
  4. Fixing git describe errors by using deep checkout (fetch-depth: 0) and calling Sync-PSTags
  5. Ensuring proper integration with the existing CI workflow structure

The conversion maintains all original functionality while using native GitHub Actions features.

Original prompt

Convert this Azure DevOps Linux Packaging pipeline to a GitHub workflow


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Convert Azure DevOps Linux packaging pipeline to GitHub workflow Convert Azure DevOps Linux Packaging pipeline to GitHub Actions workflow Oct 16, 2025
Copilot AI requested a review from TravisEz13 October 16, 2025 22:41
@TravisEz13
Copy link
Member

@copilot
Fix the following error

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/3.2.0 directory.
	/usr/lib/ruby/vendor_ruby/rubygems/installer.rb:713:in `verify_gem_home'
	/usr/lib/ruby/vendor_ruby/rubygems/installer.rb:903:in `pre_install_checks'
	/usr/lib/ruby/vendor_ruby/rubygems/installer.rb:303:in `install'
	/usr/lib/ruby/vendor_ruby/rubygems/resolver/specification.rb:105:in `install'
	/usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:195:in `block in install'
	/usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:183:in `each'
	/usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:183:in `install'
	/usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:215:in `install_gem'
	/usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:231:in `block in install_gems'
	/usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:224:in `each'
	/usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:224:in `install_gems'
	/usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:170:in `execute'
	/usr/lib/ruby/vendor_ruby/rubygems/command.rb:328:in `invoke_with_build_args'
	/usr/lib/ruby/vendor_ruby/rubygems/command_manager.rb:253:in `invoke_command'
	/usr/lib/ruby/vendor_ruby/rubygems/command_manager.rb:193:in `process_args'
	/usr/lib/ruby/vendor_ruby/rubygems/command_manager.rb:151:in `run'
	/usr/lib/ruby/vendor_ruby/rubygems/gem_runner.rb:52:in `run'
	/usr/bin/gem:12:in `<main>'
WARNING: Installation of gem dotenv 2.8.1 failed! Must resolve manually.
Exception: /home/runner/work/PowerShell/PowerShell/tools/buildCommon/startNativeExecution.ps1:40
Line |
  40 |                  throw $errorMessage
     |                  ~~~~~~~~~~~~~~~~~~~
     | Execution of { gem install dotenv -v 2.8.1 --no-document} by build.psm1:
     | line 2259 failed with exit code 1
Error: Process completed with exit code 1.

Copy link
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot
Fix the following error

...

Fixed in commit 7e4a7d5. Updated Install-GlobalGem function in build.psm1 to detect GitHub Actions environment (GITHUB_ACTIONS env var) and use sudo for gem installation, just like it does for Azure DevOps (TF_BUILD).

@TravisEz13
Copy link
Member

TravisEz13 commented Oct 16, 2025

@copilot The linux packaging job requires a deep git checkout not a shallow

@TravisEz13
Copy link
Member

@copilot The linux packaging job is failing with the following error that usually means a shallow fetch or not fetching the tags.

There is also a command in build.psm1, Sync-PSTags -AddRemoteIfMissing, to resolve this.

/home/runner/work/PowerShell/PowerShell/PowerShell.Common.props(18,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/home/runner/work/PowerShell/PowerShell/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj]
/home/runner/work/PowerShell/PowerShell/PowerShell.Common.props(18,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/home/runner/work/PowerShell/PowerShell/src/System.Management.Automation/System.Management.Automation.csproj]
/home/runner/work/PowerShell/PowerShell/PowerShell.Common.props(18,5): error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128. [/home/runner/work/PowerShell/PowerShell/src/powershell-unix/powershell-unix.csproj]

Copy link
Contributor Author

Copilot AI commented Oct 16, 2025

@copilot The linux packaging job is failing with the following error that usually means a shallow fetch or not fetching the tags.

There is also a command in build.psm1, `Sync-PSTags -AddRemoteIfMis...

Fixed in commit b8f9c3a. Updated to use fetch-depth: 0 for full git history and added Sync-PSTags -AddRemoteIfMissing call in the Bootstrap step to resolve the git describe error.

@copilot The linux packaging job requires a deep git checkout not a shallow

Fixed in commit b8f9c3a. Changed fetch-depth from 1000 to 0 for deep checkout and added Sync-PSTags -AddRemoteIfMissing to ensure tags are available.

@TravisEz13 TravisEz13 added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Oct 17, 2025
@TravisEz13 TravisEz13 marked this pull request as ready for review October 17, 2025 00:27
@TravisEz13 TravisEz13 requested review from a team and jshigetomi as code owners October 17, 2025 00:27
@TravisEz13
Copy link
Member

/azp run PowerShell-CI-linux-packaging, PowerShell-Windows-Packaging-CI

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@TravisEz13 TravisEz13 merged commit 1bd038c into master Oct 17, 2025
44 of 74 checks passed
@adityapatwardhan adityapatwardhan deleted the copilot/convert-azure-pipeline-to-github branch October 17, 2025 19:16
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-service bot commented Oct 17, 2025

📣 Hey @@Copilot, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

pwshBot pushed a commit to pwshBot/PowerShell that referenced this pull request Oct 29, 2025
TravisEz13 added a commit to TravisEz13/PowerShell that referenced this pull request Nov 5, 2025
TravisEz13 added a commit to TravisEz13/PowerShell that referenced this pull request Nov 20, 2025
SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request Dec 12, 2025
kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BackPort-7.4.x-Done BackPort-7.5.x-Done Backport-7.6.x-Migrated CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants