dotnet/nbgv

nbgv stopped working on GitHub CI in last few days after upgrade to nbgv@v0.3

edwardskrod opened this issue · 1 comments

aarnott/nbgv@master GitHub Action was no longer producing the NBGV_SIMPLEVERSION as of a few days ago.

Today, I upgraded to:
- name: Use Nerdbank.GitVersioning to set version variables
uses: aarnott/nbgv@master uses: aarnott/nbgv@v0.3
with:
setAllVars: true

This doesn't work either:
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: ". Path 'cloudBuild', line 8, position 2.

My version.json file, which hasn't changed looks like:
{
"version": "1.1",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/develop$",
"^refs/heads/rel/v\d+\.\d+"
]
}

Any ideas?
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: ". Path 'cloudBuild', line 8, position 2.
at Newtonsoft.Json.JsonTextReader.ParsePostValue()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Nerdbank.GitVersioning.VersionFile.TryReadVersionJsonContent(String jsonContent) in D:\a\1\s\src\NerdBank.GitVersioning\VersionFile.cs:line 340
at Nerdbank.GitVersioning.VersionFile.GetVersion(Commit commit, String repoRelativeProjectDirectory) in D:\a\1\s\src\NerdBank.GitVersioning\VersionFile.cs:line 75
at Nerdbank.GitVersioning.GitExtensions.CommitMatchesVersion(Commit commit, SemanticVersion expectedVersion, Position comparisonPrecision, String repoRelativeProjectDirectory) in

D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 450
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 676
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)
at Nerdbank.GitVersioning.GitExtensions.GetCommitHeight(Commit commit, Dictionary2 heights, Func2 continueStepping) in D:\a\1\s\src\NerdBank.GitVersioning\GitExtensions.cs:line 681
at System.Linq.Enumerable.Max[TSource](IEnumerable1 source, Func2 selector)

It looks like I needed to define the "cloudbuild" variable. This worked:

{ "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", "cloudBuild": { "setAllVariables": true }, "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/develop$", "^refs/heads/rel/v\\d+\\.\\d+" ], "version": "1.1" }