actions / setup-dotnet

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

global.json should allow comments #411

Closed Porges closed 1 year ago

Porges commented 1 year ago

Description:

Per the documentation, the global.json file allows comments. Adding a comment to the file causes setup-dotnet to fail to parse it.

Task version: v3

Platform:

Runner type:

Repro steps:
Add a comment to the global.json file.

Expected behavior: The file should still parse.

Actual behavior: The file does not parse.

IvanZosimov commented 1 year ago

Hi, @Porges ! Thanks for the issue, we will take a look.

nogic1008 commented 1 year ago

ref: #254

xt0rted commented 1 year ago

I have an action that wraps this one and adds support for global.json comments (plus a few other things). It's a little out of date and needs to be updated to v3 of actions/setup-dotnet, but I use it in all my repos and it's been working fine for them.

If you don't want to use this you could also copy the steps to strip the comments and then revert the change to any of your workflows.

https://github.com/xt0rted/setup-dotnet/blob/6f04e7f8ca9ff2faf76540fe2e3ebc595ca38b6b/action.yml#L79-L102

IvanZosimov commented 1 year ago

Hi, @xt0rted 👋 Thanks for the comment! Actually setup-dotnet open to any contributions, so if you feel like you may want contribute to the current version you will be more than welcome!

nikolai-laevskii commented 1 year ago

Thank you for pointing out the issue! Fix is on its way and will be available in the closest release.

karlpothast commented 1 year ago

It would be nice if you added a top level property to store the path for one master global.json file so you could just create symbolic links for any other directory. Then if want to change the SDK globally you can just toggle that one file.

IvanZosimov commented 1 year ago

Hi, @karlpothast 👋 Thank you for the comment! May I ask you to create a separate feature request for the functionality you proposed? It'd be better in terms of tracking and you could add more context/description of the feature there.

karlpothast commented 1 year ago

Thank you for replying so quickly @IvanZosimov. Actually after reviewing the overview specs I realized that the multi-line comment feature will work just fine for me.