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

未关闭
#801 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
github-actions, typescript
领域
devops, tooling

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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?

主要语言
TypeScript
星标
1.2k
派生
575
平均合并
7 天 23 小时
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

actions/setup-dotnet 的其他 Issue

查看 actions/setup-dotnet 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。