Skip to content

🩹 [Patch]: As a user I want to select when i get data from a public repo (OSS) #529

@MariusStorhaug

Description

@MariusStorhaug

Describe the change

When calling the following script with a GitHub Enterprise with Data Residency context, It doesnt get the correct "public" repo.

# This script demonstrates how to save artifacts from a GitHub repository using Save-GitHubArtifact.
$modulesPath = $env:PSModulePath -Split [IO.Path]::PathSeparator | Select-Object -First 1
Get-GitHubArtifact -Owner PSModule -Repository GitHub -Name module |
    Save-GitHubArtifact -Path $modulesPath -Extract -Force

I think we should use the default way of working as GitHub Actions does. It checks the local github instance first (i.e. the hostname that is covered within the context). It should however be a way to specify that we want to get the code from github.com or a specific instance. So it should support overrding the behavior by specifying in a parameter or forcing it to a host: i.e

  • <GitHub-Command> -Owner <MyOrg> -Repository <MyRepo> - No HostName parameter, it will check the hostname in the context first, if it doesnt exist, go to github.com as fallback to see if it exists. If so, use anonymous calls if the function supports it.
  • <GitHub-Command> -Owner <MyOrg> -Repository <MyRepo> -HostName github.com - Force to use GitHub.com.
  • <GitHub-Command> -Owner <MyOrg> -Repository <MyRepo> -HostName msx.ghe.com - Force to use local only.

Prereqs:

  • Think we need to fully have anonymous support for all the functions that have this first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions