Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 9, 2025

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

$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.


💡 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.

Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 🩹 [Patch]: Extend GitHubEnvironment properties for org and repo with urls 🩹 [Patch]: Add OwnerUrl and RepositoryUrl properties to GitHubEnvironment class Sep 9, 2025
@Copilot Copilot AI requested a review from MariusStorhaug September 9, 2025 18:29
Copilot finished work on behalf of MariusStorhaug September 9, 2025 18:29
@MariusStorhaug
Copy link
Member

@copilot Update the format to include the URL for environment and repo if its supported.

Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 9, 2025

@copilot Update the format to include the URL for environment and repo if its supported.

Updated the format to include URL examples for all URL properties (OwnerUrl, RepositoryUrl, and Url) following the same pattern used in other classes like GitHubOwner and GitHubRepository. The examples now show the expected URL format for each property. (b27e5e5)

Copilot finished work on behalf of MariusStorhaug September 9, 2025 18:36
@MariusStorhaug
Copy link
Member

@copilot Update the GitHubEnvironment.Format.xmlps1 file to add URLs to Owner and Repository names, only if the host supports it.

…ormat

Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 9, 2025

@copilot Update the GitHubEnvironment.Format.xmlps1 file to add URLs to Owner and Repository names, only if the host supports it.

Updated the GitHubEnvironment.Format.ps1xml file to add hyperlinks to Owner and Repository columns when the host supports virtual terminal (following the same pattern used in other format files). The Owner and Repository names will now be clickable links that navigate to their respective GitHub pages. (a42956a)

@Copilot Copilot AI changed the title 🩹 [Patch]: Add OwnerUrl and RepositoryUrl properties to GitHubEnvironment class 🩹 [Patch]: Add OwnerUrl and RepositoryUrl properties to GitHubEnvironment class and enable hyperlinks in format display Sep 9, 2025
Copilot finished work on behalf of MariusStorhaug September 9, 2025 18:50
@MariusStorhaug MariusStorhaug marked this pull request as ready for review September 9, 2025 19:59
@Copilot Copilot AI review requested due to automatic review settings September 9, 2025 19:59
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner September 9, 2025 19:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the GitHubEnvironment class by adding OwnerUrl and RepositoryUrl properties and enabling hyperlinks in table format display. The changes provide convenient access to related GitHub URLs and improve the user experience by making owner and repository names clickable in supported terminals.

  • Added OwnerUrl and RepositoryUrl properties to GitHubEnvironment class with automatic population in constructor
  • Updated URL property documentation with consistent examples
  • Enhanced table format display to show hyperlinks for Owner and Repository columns when terminal supports it

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/classes/public/Environment/GitHubEnvironment.ps1 Added new URL properties and updated documentation with examples
src/formats/GitHubEnvironment.Format.ps1xml Enhanced table display with hyperlinks for Owner and Repository columns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MariusStorhaug MariusStorhaug merged commit 4d83c75 into main Sep 9, 2025
86 of 94 checks passed
@MariusStorhaug MariusStorhaug deleted the copilot/fix-455 branch September 9, 2025 20:03
@github-project-automation github-project-automation bot moved this from Todo to Done in GitHub PowerShell Module Sep 9, 2025
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Module GitHub - 0.36.11 published to the PowerShell Gallery.

Copy link
Contributor

github-actions bot commented Sep 9, 2025

GitHub release for GitHub v0.36.11 has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🩹 [Patch]: Extend GitHubEnvironment properties for org and repo with urls
2 participants