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: 413bc5c
Choose a base ref
...
head repository: PSModule/GitHub
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3367f90
Choose a head ref
  • 1 commit
  • 18 files changed
  • 1 contributor

Commits on Jun 12, 2025

  1. 🚀 [Feature]: Add class for GitHubApp and GitHubAppInstallation (#…

    …406)
    
    ## Description
    
    This pull request introduces significant enhancements to the GitHub Apps
    module by adding new classes, improving type safety, and refining
    existing functions. The changes focus on creating structured
    representations for GitHub Apps and their installations, updating
    function outputs to use these new types, and improving parameter
    handling for better usability and clarity.
    
    ### New Classes for GitHub Apps and Installations:
    *
    [`src/classes/public/App/GitHubApp.ps1`](diffhunk://#diff-067422a4a7efa7c966720b01cb15b3868f47b408676fd32b13c0d0a5fd13f28fR1-R66):
    Introduced the `GitHubApp` class to encapsulate properties and methods
    for GitHub Apps, including `ID`, `ClientID`, `Slug`, `Permissions`, and
    `Events`. This improves type safety and enables structured handling of
    app data.
    *
    [`src/classes/public/App/GitHubAppInstallation.ps1`](diffhunk://#diff-c1442a9fa3e51d2f0bf378039e97400122a24423d72d534112ca6f7c06a5ffaeR1-R63):
    Added the `GitHubAppInstallation` class to represent app installations,
    including `ID`, `Target`, `Permissions`, and `CreatedAt`. This
    facilitates better organization and manipulation of installation data.
    
    ### Updates to Function Outputs:
    * [`src/functions/private/Apps/GitHub
    Apps/Get-GitHubAppByName.ps1`](diffhunk://#diff-2446812fa850e0b15e44ea484a0ef116efbe4b5d7e22b74960faf084b4015256L17-R17):
    Changed output type from `[pscustomobject]` to `[GitHubApp]` and updated
    the response handling to instantiate `GitHubApp` objects.
    [[1]](diffhunk://#diff-2446812fa850e0b15e44ea484a0ef116efbe4b5d7e22b74960faf084b4015256L17-R17)
    [[2]](diffhunk://#diff-2446812fa850e0b15e44ea484a0ef116efbe4b5d7e22b74960faf084b4015256L46-R46)
    * [`src/functions/private/Apps/GitHub
    Apps/Get-GitHubAppInstallationForAuthenticatedApp.ps1`](diffhunk://#diff-f58f23b4edc1de29c735a7576182208d9f0d4908650818560c1d5a20e4a59674R17-R29):
    Updated output type to `[GitHubAppInstallation[]]` and modified response
    processing to create instances of `GitHubAppInstallation`.
    [[1]](diffhunk://#diff-f58f23b4edc1de29c735a7576182208d9f0d4908650818560c1d5a20e4a59674R17-R29)
    [[2]](diffhunk://#diff-f58f23b4edc1de29c735a7576182208d9f0d4908650818560c1d5a20e4a59674R45-R52)
    * [`src/functions/private/Apps/GitHub
    Apps/Get-GitHubEnterpriseOrganizationAppInstallation.ps1`](diffhunk://#diff-cb918ad0c83be9fde80efae340f437639173ba82a5a363ef7b1a9be93e05dfd5L19-R19):
    Updated output type to `[GitHubAppInstallation]` and adjusted response
    handling for better type safety.
    [[1]](diffhunk://#diff-cb918ad0c83be9fde80efae340f437639173ba82a5a363ef7b1a9be93e05dfd5L19-R19)
    [[2]](diffhunk://#diff-cb918ad0c83be9fde80efae340f437639173ba82a5a363ef7b1a9be93e05dfd5L61-R61)
    
    ### Refinements to Parameter Handling:
    * [`src/functions/public/Apps/GitHub
    App/Get-GitHubApp.ps1`](diffhunk://#diff-eb4b0ed1f801228094dc7d155d3b2cd9a7a417d294ead8583bdfa87e455efcd5L27-R36):
    Improved parameter set names for clarity, such as renaming `'BySlug'` to
    `'Get an app by slug'`. Added alias `Slug` for the `Name` parameter to
    enhance usability.
    [[1]](diffhunk://#diff-eb4b0ed1f801228094dc7d155d3b2cd9a7a417d294ead8583bdfa87e455efcd5L27-R36)
    [[2]](diffhunk://#diff-eb4b0ed1f801228094dc7d155d3b2cd9a7a417d294ead8583bdfa87e455efcd5L53-R53)
    * [`src/functions/public/Apps/GitHub App
    Installations/Get-GitHubAppInstallation.ps1`](diffhunk://#diff-9ca965372ef6314e8f8759ce87dedff3c8a0d216fe06fda41e0fb38b89722dfeL14-R39):
    Refined parameter sets to clearly differentiate between listing
    installations for enterprises, organizations, and authenticated apps.
    [[1]](diffhunk://#diff-9ca965372ef6314e8f8759ce87dedff3c8a0d216fe06fda41e0fb38b89722dfeL14-R39)
    [[2]](diffhunk://#diff-9ca965372ef6314e8f8759ce87dedff3c8a0d216fe06fda41e0fb38b89722dfeL55-R74)
    
    ### Adjustments to Existing Classes:
    *
    [`src/classes/public/Owner/GitHubOwner.ps1`](diffhunk://#diff-41f600a6b5b0e373d0e53465e24c629e95b33f9864c206542e843fc2a269bcabL78-R84):
    Updated property mappings to handle both `slug` and `login` for `Name`
    and added fallback for `Blog` using `website_url`.
    
    ### Context Improvements:
    *
    [`src/functions/private/Auth/Context/Set-GitHubContext.ps1`](diffhunk://#diff-600a257f8ea7acdd36413aef2daf597ab69dd5bb3c17ec7d6fed83e15f0af1d7L81-R81):
    Updated context object properties to use the new `GitHubApp` class,
    ensuring consistency and type safety across app-related context data.
    [[1]](diffhunk://#diff-600a257f8ea7acdd36413aef2daf597ab69dd5bb3c17ec7d6fed83e15f0af1d7L81-R81)
    [[2]](diffhunk://#diff-600a257f8ea7acdd36413aef2daf597ab69dd5bb3c17ec7d6fed83e15f0af1d7L125-R133)
    
    ## Type of change
    
    <!-- Use the check-boxes [x] on the options that are relevant. -->
    
    - [ ] 📖 [Docs]
    - [ ] 🪲 [Fix]
    - [ ] 🩹 [Patch]
    - [ ] ⚠️ [Security fix]
    - [x] 🚀 [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 Jun 12, 2025
    Configuration menu
    Copy the full SHA
    3367f90 View commit details
    Browse the repository at this point in the history
Loading