lib/github: better type safety on json accesses