actions / setup-dotnet

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

Comments in global.json breaks actions/setup-dotnet #493

Closed drewid closed 5 months ago

drewid commented 6 months ago

Description: Comments in global.json breaks actions/setup-dotnet. Used the typical "//" notation explicitly allowed in the reference document: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#comments-in-globaljson.

However, when the GitHub action reaches actions/setup-dotnet the action fails with the message: Unexpected token / in JSON at position 5

Task version: v3

Platform:

Runner type:

Repro steps:
A global.json with the following content breaks the action:

{
  // https://learn.microsoft.com/en-us/dotnet/core/tools/global-json
  "sdk": {
    "version": "8.0.0",
    "rollForward": "latestFeature",
    "allowPrerelease": false
  }
}

Removing the comment line makes the action run successfully.

Expected behavior: Expected behavior is for the action to run successfully, with comments, as explicitly mentioned in the reference document.

Actual behavior: Action fails with the message: Unexpected token / in JSON at position 5

dusan-trickovic commented 6 months ago

Hello, @drewid! Thank you for creating an issue, we will take a look into it and see what can be done :)

tilemanrenovations commented 6 months ago

[JR]&(M1)+ {null}<-1> ==tN4==💯TRUE ~@custom-installs\* TMR.biz.vip(00005611_31)"😎".me

priya-kinthali commented 6 months ago

Hello @drewid, thanks for creating this issue. The functionality related to allowing the comments in global.json has been added as part of this v4 release . Please upgrade the version from v3 to v4 i.e actions/setup-dotnet@v4. If you have any questions,Please feel free to share them.

priya-kinthali commented 5 months ago

Hello @drewid , just a gentle reminder if you could confirm the above mentioned fix helped.

priya-kinthali commented 5 months ago

Hello @drewid , Due to inactivity on this issue, I am going to proceed with closing it. If you continue to experience any problem, please feel free to reopen the issue or create a new one. Thank you :)