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.38.0
Choose a base ref
...
head repository: PSModule/GitHub
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.38.1
Choose a head ref
  • 2 commits
  • 15 files changed
  • 3 contributors

Commits on Sep 16, 2025

  1. 🩹 [Patch]: Prevent ArgumentCompleters from falling back to the defaul…

    …t file path completion (#515)
    
    This PR addresses an issue where PowerShell argument completers would
    fall back to file path completion when no valid argument matches were
    found, leading to irrelevant file and folder suggestions.
    
    ## Problem
    
    When using argument completion with GitHub PowerShell module commands,
    if no matches were found for the typed input, PowerShell would default
    to showing file and folder completions from the current directory. This
    created a confusing user experience where typing something like:
    
    ```powershell
    Get-GitHubLicense -Name invalidlicense<TAB>
    ```
    
    Would show local files and folders instead of no completions, suggesting
    invalid options to the user.
    
    ## Solution
    
    Updated all 34 argument completers across 14 files to explicitly return
    `$null` when no matches are found. The fix follows this pattern:
    
    **Before:**
    ```powershell
    Get-GitHubLicense @params | Where-Object { $_.Name -like $pattern } | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name)
    }
    ```
    
    **After:**
    ```powershell
    $filteredOptions = Get-GitHubLicense @params | Where-Object { $_.Name -like $pattern }
    if (-not $filteredOptions) {
        return $null
    }
    $filteredOptions | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name)
    }
    ```
    
    ## Result
    
    - ✅ When valid matches exist: Shows appropriate completions as before
    - ✅ When no matches exist: No completions shown (cursor stays in place)
    - ❌ Previously: Would show irrelevant file/folder completions when no
    matches found
    
    This provides a cleaner, more intuitive completion experience that
    doesn't suggest invalid options to users.
    
    ## Files Modified
    
    All completer files throughout the module structure:
    - Core completers in `/src/completers.ps1`
    - Function-specific completers in
    `/src/functions/public/*/completers.ps1`
    
    Fixes #514.
    
    <!-- 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 16, 2025
    Configuration menu
    Copy the full SHA
    002492b View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2025

  1. 🪲 [Fix]: Fixing the Secrets test for PublicKey for codespaces (#…

    …518)
    
    ## Description
    
    This pull request updates the `Secrets.Tests.ps1` test suite to improve
    how the `Get-GitHubPublicKey` command is tested for different
    organization plans and makes a minor formatting change to a log message.
    
    Test logic improvements for organization plan handling:
    
    * Updated the `Get-GitHubPublicKey -Type codespaces` test to
    conditionally expect a throw for organizations on the 'free' plan, and
    to run the usual public key retrieval for other plans. This ensures the
    test behaves correctly based on the organization's plan type.
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [x] 🪲 [Fix]
    - [ ] 🩹 [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 17, 2025
    Configuration menu
    Copy the full SHA
    e66d934 View commit details
    Browse the repository at this point in the history
Loading