Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PSModule/GitHub
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.36.8
Choose a base ref
...
head repository: PSModule/GitHub
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 4 commits
  • 17 files changed
  • 3 contributors

Commits on Sep 7, 2025

  1. 🪲[Fix]: Piping GitHubSecret and GitHubVariable objects to `Remove…

    …-GitHubSecret` and `Remove-GitHubVariable` (#499)
    
    This pull request improves the handling and testing of secret and
    variable removal in the GitHub module. The main focus is on making the
    removal functions (`Remove-GitHubSecret`, `Remove-GitHubVariable`) more
    robust and scope-aware, and on expanding the test coverage to ensure
    correct behavior across different usage patterns and scopes.
    
    - Fixes #388
    
    Key changes include:
    
    ### Functional improvements to removal logic
    
    * Updated `Remove-GitHubSecret.ps1` and `Remove-GitHubVariable.ps1` to
    dispatch removal actions based on the `Scope` property of each item,
    ensuring the correct removal function is called for environment,
    repository, or organization scopes, and providing clear error handling
    for unsupported scopes.
    
    ### Documentation and class property clarifications
    
    * Improved property descriptions in `GitHubSecret.ps1` and
    `GitHubVariable.ps1` to clarify that properties refer to where the
    secret or variable is stored, enhancing code readability and
    maintainability.
    
    ### Expanded and improved test coverage
    
    * Refactored and expanded tests in `Secrets.Tests.ps1` and
    `Variables.Tests.ps1` to:
    - Add separate tests for pipeline-based removal using both direct
    pipeline and variable assignment approaches.
    - Ensure secrets and variables are created and removed correctly in all
    supported scopes.
    - Add logging and verification steps to improve test clarity and
    debugging.
    
    These changes make the module's behavior more predictable and easier to
    test, especially when handling secrets and variables in different scopes
    and using pipeline operations.
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
    Co-authored-by: Marius Storhaug <marstor@hotmail.com>
    3 people authored Sep 7, 2025
    Configuration menu
    Copy the full SHA
    9e7a331 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2025

  1. 🩹 [Patch]: Add Fine-Grained Permissions Data for GitHub PowerShell Mo…

    …dule (#501)
    
    This PR implements a comprehensive fine-grained permissions data
    infrastructure for the GitHub PowerShell module, enabling detection of
    GitHub App installations that may be missing newly added permissions.
    
    - Fixes #485
    
    ## What's New
    
    ### GitHubPermission Class
    Added a new public `GitHubPermission` class with the following
    properties:
    - **Name** - Programmatic permission name (e.g., `contents`, `issues`)
    - **DisplayName** - Human-friendly name (e.g., "Contents", "Issues")
    - **Description** - Brief description of what access the permission
    grants
    - **URL** - Link to relevant GitHub documentation
    - **Options** - Available access levels (`read`, `write`, `admin`)
    - **Type** - Permission type (`Fine-grained`, `Classic`)
    - **Scope** - Application scope (`Repository`, `Organization`, `User`,
    `Enterprise`)
    
    ### Comprehensive Permissions Database
    Added 90 fine-grained permissions covering all major GitHub permission
    categories:
    - **33 Repository permissions** - actions, contents, issues,
    pull_requests, secrets, etc.
    - **33 Organization permissions** - members, administration,
    organization_secrets, etc.
    - **18 User permissions** - profile, followers, git_ssh_keys, etc.
    - **6 Enterprise permissions** - custom properties, organization
    installation, etc.
    
    ### Get-GitHubPermissionDefinition Function
    New public function to query the permissions database with advanced
    filtering:
    
    ```powershell
    # Get all permissions
    Get-GitHubPermissionDefinition
    
    # Filter by scope
    Get-GitHubPermissionDefinition -Scope Repository
    
    # Combined filtering
    Get-GitHubPermissionDefinition -Type Fine-grained -Scope Organization
    
    # Find specific permissions
    Get-GitHubPermissionDefinition -Name 'contents'
    ```
    
    ### Argument Completers
    Added argument completers for `Get-GitHubPermissionDefinition`
    parameters to improve user experience:
    - **Name** - Tab completion for available permission names (actions,
    contents, issues, etc.)
    - **DisplayName** - Tab completion for available permission display
    names (Actions, Dependabot alerts, etc.)
    - **Type** - Tab completion for available permission types
    (Fine-grained)
    - **Scope** - Tab completion for available scopes (Repository,
    Organization, User, Enterprise)
    
    ## Use Cases
    
    This infrastructure enables several key scenarios:
    
    1. **Permission Validation** - Compare GitHub App installations against
    the complete permissions list
    2. **Installation Health Checks** - Detect apps missing newly added
    permissions
    3. **Documentation** - Provide users with comprehensive permission
    reference
    4. **Automation** - Build tools that ensure installations stay current
    with permission requirements
    5. **Enhanced User Experience** - Tab completion for parameter values
    improves usability
    
    ## Implementation Details
    
    - **File path permissions excluded** - These are handled differently by
    the GitHub API (appear under `FilePaths` property rather than as named
    permissions)
    - **Maintainable structure** - Easy to update when GitHub adds new
    permissions
    - **Performance optimized** - Efficient filtering and lookup operations
    - **Comprehensive testing** - Full test coverage for all functionality
    - **Argument completion** - Improves user experience with tab completion
    support
    
    ## Example Usage
    
    ```powershell
    # Check what repository permissions are available (with tab completion)
    $repoPerms = Get-GitHubPermissionDefinition -Scope <TAB>
    Write-Host "Repository permissions: $($repoPerms.Count)"
    
    # Get details about the contents permission (with tab completion)
    $contents = Get-GitHubPermissionDefinition -Name cont<TAB>
    Write-Host "$($contents.DisplayName): $($contents.Description)"
    Write-Host "Available options: $($contents.Options -join ', ')"
    ```
    
    This provides the foundation for building automated permission
    management tools and ensuring GitHub App installations remain up-to-date
    with the latest permission requirements.
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
    Co-authored-by: Marius Storhaug <marstor@hotmail.com>
    3 people authored Sep 9, 2025
    Configuration menu
    Copy the full SHA
    fff966d View commit details
    Browse the repository at this point in the history
  2. 🩹 [Patch]: Add OwnerUrl and RepositoryUrl properties to GitHubEnviron…

    …ment class and enable hyperlinks in format display (#502)
    
    ## 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] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
    Copilot and MariusStorhaug authored Sep 9, 2025
    Configuration menu
    Copy the full SHA
    4d83c75 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2025

  1. 🩹 [Patch]: Sort the return for Get-GitHubContext (#505)

    ## Description
    
    This pull request focuses on improving the usability and consistency of
    the GitHub context management PowerShell module. The main changes
    include renaming parameter sets and internal logic for clarity, ensuring
    output is sorted for better user experience, and updating the context
    completer for more accurate and user-friendly suggestions.
    
    - Fixes #503
    
    **Parameter set and logic improvements:**
    
    * Renamed parameter sets in `Get-GitHubContext.ps1` for clarity (e.g.,
    `'NamedContext'` to `'Get a named context'`, `'ListAvailableContexts'`
    to `'List all available contexts'`) and updated corresponding internal
    logic and debug messages for consistency.
    
    **Output and completion enhancements:**
    
    * Sorted the output of contexts by name in `Get-GitHubContext.ps1` to
    provide a more organized and predictable result.
    * Moved `completers.ps1` from the private to public directory, and
    updated the context completer to suppress debug output, sort and
    deduplicate context names, and improve the accuracy of completion
    suggestions.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [x] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [ ] 🚀 [Feature]
    - [ ] 🌟 [Breaking change]
    
    ## Checklist
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [x] I have performed a self-review of my own code
    - [x] I have commented my code, particularly in hard-to-understand areas
    MariusStorhaug authored Sep 10, 2025
    Configuration menu
    Copy the full SHA
    8ef51f0 View commit details
    Browse the repository at this point in the history
Loading