Conversation
Co-authored-by: arturcic <1760506+arturcic@users.noreply.github.com>
Co-authored-by: arturcic <1760506+arturcic@users.noreply.github.com>
|
@copilot add a <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>Update the ci github action and ci azure devops to use this file |
Co-authored-by: arturcic <1760506+arturcic@users.noreply.github.com>
... Done. Added
Commit: 3b57358 |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for custom NuGet configuration files to the GitTools actions, allowing users to specify alternative package sources when installing GitVersion and GitReleaseManager tools. This is particularly useful in enterprise environments with restricted access to public NuGet feeds.
Key changes:
- Added
nugetConfigPathparameter to setup actions for both GitVersion and GitReleaseManager - Updated tool installation logic to use custom NuGet config when provided
- Added documentation and examples demonstrating the new feature
Reviewed Changes
Copilot reviewed 14 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tools/common/models.ts | Added nugetConfigPath property to SetupSettings type |
| src/tools/common/settings.ts | Modified to retrieve nugetConfigPath input and include it in settings |
| src/tools/common/dotnet-tool.ts | Updated installTool method to accept and use nugetConfigPath parameter |
| src/tests/tools/common/settings.spec.ts | Added test case for nugetConfigPath setting |
| src/tests/tools/common/dotnet-tool.spec.ts | Updated test fixture to include nugetConfigPath |
| gitversion/setup/action.yml | Added nugetConfigPath input definition |
| gitreleasemanager/setup/action.yml | Added nugetConfigPath input definition |
| docs/examples/github/gitversion/setup.md | Added documentation and example usage |
| docs/examples/github/gitreleasemanager/setup.md | Added documentation and example usage |
| docs/examples/azure/gitversion/setup.md | Added documentation and example usage |
| docs/examples/azure/gitreleasemanager/setup.md | Added documentation and example usage |
| nuget.config | Added sample NuGet configuration file |
| dist/tools/libs/tools.mjs | Compiled output reflecting TypeScript changes |
| dist/tools/libs/tools.mjs.map | Source map reflecting TypeScript changes |
| dist/azure/gitversion/setup/task.json | Added nugetConfigPath input for Azure task |
| dist/azure/gitreleasemanager/setup/task.json | Added nugetConfigPath input for Azure task |
| .github/workflows/ci.yml | Added example usage in CI workflow |
| .azure/ci.yml | Added example usage in Azure CI pipeline |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: arturcic <1760506+arturcic@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 13 out of 17 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/tools/common/settings.ts
Outdated
| ignoreFailedSources, | ||
| preferLatestVersion | ||
| preferLatestVersion, | ||
| nugetConfigPath: nugetConfigPath || undefined |
There was a problem hiding this comment.
The expression nugetConfigPath || undefined will convert an empty string to undefined, which may not be the intended behavior. If an empty string is a valid input (as suggested by the default value '' in action.yml files), this will incorrectly convert it to undefined. Consider using nullish coalescing (??) instead: nugetConfigPath: nugetConfigPath || undefined should be nugetConfigPath: nugetConfigPath ? nugetConfigPath : undefined or remove the conversion entirely if empty strings should be preserved.
| nugetConfigPath: nugetConfigPath || undefined | |
| nugetConfigPath: nugetConfigPath |
There was a problem hiding this comment.
Removed the || undefined conversion. The if (nugetConfigPath) check in dotnet-tool.ts already handles empty strings correctly (treats them as falsy), so the conversion was unnecessary.
Commit: a9ab30a
Co-authored-by: arturcic <1760506+arturcic@users.noreply.github.com>
|
1 similar comment
|
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 13 out of 17 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 13 out of 17 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you @Copilot for your contribution! |



nugetConfigPathinput to GitHub Actions setup (gitversion/setup/action.yml)nugetConfigPathinput to GitHub Actions setup (gitreleasemanager/setup/action.yml)nugetConfigPathinput to Azure DevOps task definition (dist/azure/gitversion/setup/task.json)nugetConfigPathinput to Azure DevOps task definition (dist/azure/gitreleasemanager/setup/task.json)SetupSettingsmodel to includenugetConfigPathfield (src/tools/common/models.ts)SettingsProvider.getSetupSettings()to readnugetConfigPathinput (src/tools/common/settings.ts)DotnetTool.installTool()to accept and use nugetConfigPath parameter (src/tools/common/dotnet-tool.ts)DotnetTool.install()to pass nugetConfigPath to installTool (src/tools/common/dotnet-tool.ts)Summary
Successfully implemented support for custom NuGet configuration files in the gitversion-setup and gitreleasemanager-setup actions/tasks. The implementation:
✅ Minimal Changes: Only modified the necessary files to add the new parameter
✅ Backward Compatible: Existing workflows will continue to work without modification
✅ Well Tested: Added unit tests and all existing tests pass (except 8 pre-existing failures unrelated to this change)
✅ Documented: Added usage examples for both GitHub Actions and Azure DevOps
✅ Secure: Passed both code review and security scan with no issues
✅ Consistent: Applied the same change to both GitVersion and GitReleaseManager tools
✅ CI Integration: Added nuget.config and updated both GitHub and Azure DevOps CI pipelines to use it
✅ Type Safe: Made nugetConfigPath properly optional in TypeScript type definitions
✅ Clean Code: Removed unnecessary type conversions based on review feedback
Security Summary
No vulnerabilities were discovered during the security scan. The implementation safely passes user-provided configuration file paths to the
dotnet tool installcommand using the standard--configfileargument.Original prompt
💡 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.