microsoft / PowerShellForGitHub

Microsoft PowerShell wrapper for GitHub API
Other
582 stars 184 forks source link

Add GitHub API versioning header #377

Closed variableresistor closed 1 year ago

variableresistor commented 1 year ago

Feature Idea Summary

Add versioning to API request header.

Feature Idea Additional Details

GitHub has announced that they will start versioing their API. It's best to add the version to the API header. Using the 'X-GitHub-Api-Version' header and setting the value to the first version of their API '2022-11-28'.

https://github.blog/2022-11-28-to-infinity-and-beyond-enabling-the-future-of-githubs-rest-api-with-api-versioning/

Requested Assignment

If possible, I would like to implement this.

    $headers = @{
        'Accept' = $AcceptHeader
        'User-Agent' = 'PowerShellForGitHub'
        'X-GitHub-Api-Version'='2022-11-28'
    }

Operating System

OsName : Microsoft Windows 10 Enterprise OsOperatingSystemSKU : EnterpriseEdition OsArchitecture : 64-bit WindowsVersion : 2009 WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 OsLanguage : en-US OsMuiLanguages : {en-US}

PowerShell Version

PSVersion 7.2.6 PSEdition Core GitCommitId 7.2.6 OS Microsoft Windows 10.0.19044 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

Module Version

Running: 0.16.1 Installed: 0.16.1