actions / setup-dotnet

Set up your GitHub Actions workflow with a specific version of the .NET core sdk
MIT License
919 stars 454 forks source link

Support registration manual NuGet source to NuGet.Config #415

Open 134130 opened 1 year ago

134130 commented 1 year ago

Description: Support registration manual NuGet source to NuGet.Config

Justification: When we uses private NuGet repository like nexus, We need to configure our source to NuGet.Config.

I'm currently using with these code, But It is too long and scattered in many workflows.

- name: Add NuGet source (Private Nexus)
  id: add-nuget-source
  run: |
    dotnet nuget remove source Nexus | true
    dotnet nuget add source ${{ secrets.PRIVATE_NUGET_SOURCE }} \
      --name Nexus \
      --username ${{ secrets.PRIVATE_AGENT_NEXUS_USERNAME }} \
      --password ${{ secrets.PRIVATE_AGENT_NEXUS_PASSWORD }} \
      --store-password-in-clear-text

Also, we need to remove this configure with these code when using ghcr.

- name: Remove NuGet source (Private Nexus)
  if: ${{ always() && steps.add-nuget-source.conclusion == 'success' }}
  run: dotnet nuget remove source Nexus | true

Are you willing to submit a PR? Yes, I'm interested in. But I need a help. I don't know nice way to resolve these many arguments. Some idea please

IvanZosimov commented 1 year ago

Hi, @134130, thank you for the feature request! We will investigate the issue and get back to you with updates!