I'm not an expert, but...
Form this library sample code JsonParserExample.ino | ArduinoJson 6
] it is apparent that first
you must deserialize and then
you can fetch the values (e.g.
stars = doc["stargazers"]["totalCount"];
The sample code also shows you how to handle deserialization errors.