You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Changes Made
Added two new properties to the `GitHubEnvironment` class:
- `OwnerUrl` - URL to the owner/organization profile (e.g.,
`https://github.com/octocat`)
- `RepositoryUrl` - URL to the repository (e.g.,
`https://github.com/octocat/Hello-World`)
These properties are automatically populated in the constructor using
the existing `Context.HostName` pattern, ensuring compatibility with
both GitHub.com and GitHub Enterprise instances.
Updated the URL property comments to include examples following the same
format used in other classes:
- `OwnerUrl` - Example: `https://github.com/octocat`
- `RepositoryUrl` - Example: `https://github.com/octocat/Hello-World`
- `Url` - Example:
`https://github.com/octocat/Hello-World/settings/environments/123/edit`
Updated the `GitHubEnvironment.Format.ps1xml` file to add hyperlinks to
Owner and Repository columns when the host supports virtual terminal
(and not running in GitHub Actions), following the same pattern used in
other format files.
## Example Usage
```powershell
$environment = Get-GitHubEnvironment -Owner 'octocat' -Repository 'Hello-World' -Name 'production'
# New properties provide direct access to related URLs
Write-Host "Owner URL: $($environment.OwnerUrl)" # https://github.com/octocat
Write-Host "Repository URL: $($environment.RepositoryUrl)" # https://github.com/octocat/Hello-World
Write-Host "Environment URL: $($environment.Url)" # https://github.com/octocat/Hello-World/settings/environments/123/edit
```
Now when displaying GitHubEnvironment objects in a table format, the
Owner and Repository names will be clickable hyperlinks (when terminal
supports it) that navigate to their respective GitHub pages.
## Benefits
- **Consistency**: Follows the same URL pattern and documentation format
established by other classes like `GitHubRepository` and `GitHubOwner`
- **Enhanced UX**: Owner and Repository names are now clickable links in
terminal environments that support hyperlinks
- **Convenience**: Users no longer need to manually construct
organization or repository URLs
- **Enterprise Support**: Works seamlessly with custom GitHub Enterprise
hostnames
- **Non-breaking**: Purely additive changes that don't affect existing
functionality
Fixes#455.
<!-- START COPILOT CODING AGENT TIPS -->
---
đź’ˇ 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](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: MariusStorhaug <[email protected]>
0 commit comments