Add inputs for a custom download feed (azure-feed, uncached-feed, feed-credential)

Open
#801 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 7 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, typescript
Domain
devops, tooling

Research direction

Start with src/installer.ts and trace how DotnetInstallScript builds arguments for the bundled scripts externals/install-dotnet.sh and externals/install-dotnet.ps1; check the action input definitions and related tests to see how inputs are wired. Done means all three feed values reach the matching OS option and the credential is masked with core.setSecret(). The releases-index URL is described as optional.

Written by the indexing model from the issue text.

Description

feature request

Description:
Add inputs to set a custom download feed (mirror or proxy) for the .NET install script.

The bundled install scripts (externals/install-dotnet.sh and externals/install-dotnet.ps1) already support these options:

Bash option PowerShell option Function
--azure-feed -AzureFeed Sets the base URL for the download of the SDK and runtime archives
--uncached-feed -UncachedFeed Sets the base URL for uncached downloads
--feed-credential -FeedCredential Adds a query string (for example a SAS token) to each feed URL

At this time, the action does not send these options to the script. DotnetInstallScript in src/installer.ts only adds -ProxyAddress and -ProxyBypassList on Windows.

Proposed usage:

- uses: actions/setup-dotnet@v6
  with:
    dotnet-version: '9.0.x'
    dotnet-feed: 'https://artifactory.example.com/artifactory/dotnet'
    dotnet-uncached-feed: 'https://artifactory.example.com/artifactory/dotnet'
    dotnet-feed-credential: ${{ secrets.DOTNET_FEED_CREDENTIAL }}

Expected behavior:

  1. The action sends each value to the install script with the correct option for the OS (--azure-feed or -AzureFeed, and the other options).
  2. The action masks the credential with core.setSecret(), so that it does not show in the logs.
  3. Optional: an input to set the URL of releases-index.json. The action downloads this file from https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json to find the latest version for A.x and A.B.x. If the runner cannot get access to this URL, floating versions fail even with a custom feed (see #762).

Justification:

  • Many companies use self-hosted runners in a closed network. These runners can only download through an internal mirror or proxy repository (Artifactory, Nexus, Azure Blob Storage). They cannot get access to builds.dotnet.microsoft.com.
  • The https_proxy variable is not always a solution. Some networks allow only a repository mirror, not an HTTP proxy.
  • In some regions, the download from the default CDN is slow (see #450). A mirror near the runner makes the download faster.
  • At this time, the only workaround is to not use this action and run dotnet-install manually. Then the workflow loses the other features of the action (cache, global-json-file, NuGet authentication, problem matchers).

Related: #450, #762

Are you willing to submit a PR?

Dominant language
TypeScript
Stars
1.2k
Forks
579
Avg merge
6d 4h
Merged PRs (30d)
1

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from actions/setup-dotnet

All issues in actions/setup-dotnet

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.