microsoft / PowerShellForGitHub

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

Add option to manage Autolink references on a repository #368

Open henkmeulekamp opened 1 year ago

henkmeulekamp commented 1 year ago

Feature Idea Summary

I would like the PowerShellForGitHub be able to manage the autolink references on a given repository. https://docs.github.com/en/rest/repos/autolinks#create-an-autolink-reference-for-a-repository

{ "id": 1, "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=", "is_alphanumeric": true }

Feature Idea Additional Details

Add the following to get existing list of autolinks, create a new, or remove a given auto-reference

Example

Get-GitHubRepositoryAutoLink  [-OwnerName <String>] [-RepositoryName <String>] [-AccessToken <String>]

New-GitHubRepositoryAutoLink  [-OwnerName <String>] [-RepositoryName <String>] [-AccessToken <String>] 
  [-KeyPrefix <String>]  [-UrlTemplate <String>]  [-IsAlphaNumeric] 

Remove-GitHubRepositoryAutoLink  [-OwnerName <String>] [-RepositoryName <String>] [-AccessToken <String>] 
  [-AutoLinkId] <Int64> [-Force] [-WhatIf] [-Confirm]

Requested Assignment

Operating System

OsName : Microsoft Windows 11 Pro OsOperatingSystemSKU : 48 OsArchitecture : 64-bit WindowsVersion : 2009 WindowsBuildLabEx : 22000.1.amd64fre.co_release.210604-1628 OsLanguage : en-US OsMuiLanguages : {en-US, en-GB}

PowerShell Version

Name Value


PSVersion 7.2.6 PSEdition Core GitCommitId 7.2.6 OS Microsoft Windows 10.0.22000 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: Installed: 0.16.1

HowardWolosky commented 1 year ago

Thanks for the suggestion, @henkmeulekamp. Sounds good -- go ahead and start working on it if you'd like. The main question I have around the API design is [-IsAlphaNumeric]. According to the docs, the published API defaults to true for that. Are you suggestion changing the default behavior such that users must supply that switch? If not, then I think you'd want to change your design so that the switch is named [IsNumericOnly] or something similar so that if left off, we still get the published default behavior.