---
title: "Comment by behrooz bozorgchamy on \"GitHub action to publish .NET packages to NuGet\" | Hashnode"
description: "Hi I found some issues in your sample You can replace the configuration flag with env you set like dotnet pack src / proj / proj.csproj - o ./artifacts - - conf"
url: "https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38/comment/6215e53ca03ae28fe10fc7f0"
---

[Discussion](https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38)

Comment [GitHub action to publish .NET packages to NuGet](https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38)

[behrooz bozorgchamy](https://hashnode.com/@behroozbc)

[Feb 23, 2022](https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38/comment/6215e53ca03ae28fe10fc7f0)

Hi I found some issues in your sample

1.  You can replace the `configuration` flag with `env` you set like
    
    ```
    dotnet pack src/proj/proj.csproj -o ./artifacts --configuration ${{env.config}}
    ```
    
2.  You can change `env.dotnet_core_version` to **6.0.x** to download latest security updates of .NET 6
3.  I think `env.DOTNET_CLI_TELEMETRY_OPTOUT` and `env.DOTNET_SKIP_FIRST_TIME_EXPERIENCE` are not necessary and you can remove them. this is my [test](https://github.com/behroozbc/CronJobNet/actions/workflows/nuget_push.yml%20to%20check%20it)

[Babu Annamalai](https://hashnode.com/@mysticmind)

[Feb 23, 2022](https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38/comment/6215e53ca03ae28fe10fc7f0#reply-62165e773b11209c8fb4bd8f)

Using ${{env.config}} in `dotnet pack` - good catch, updated it.

Setting `env.dotnet_core_version` to `6.0.x` is better as you have outlined. Note that it is still an environment variable and the value can be changed as you see it fit, it is just an example.

With regards to `env.DOTNET_CLI_TELEMETRY_OPTOUT` and `env.DOTNET_SKIP_FIRST_TIME_EXPERIENCE`, GH action will run fine but the first run of any `dotnet` command will eat up some time sending telemetry data to Microsoft so it is always better to set these flags to disable it.
