Human elected leader of country.
Weather occurring in geographic region.
Team lost game. Team won game. There will be more games.
Human incarcerated after conviction of crime.
By this principle it's not a crime for a delvery man to be in posession of contraband that he has no knowledge of. This isn't to be confused with not knowing something is illegal. That's no defense. It's about knowing or not knowing the consequences of your action.
That said there are lesser offences, misdemenors or summary offences, where mens rea is not required. They usually have fines but also can have limited jail time. For example, you can be punished for speeding and whether you knew you were doing it or not is irrelevent.
What's unclear in this case is whether the developer knew or ought to have known there were secrets in the code, or that his push was to a public place. It's also unclear, at least to me, whether Chinese law requires mens rea.
I understand HN guideline here. I am talking about the Guardian's post.
Leaking private information to the public even unintentionally , that compromise the security of software and may cause public harm is illegal no matter which country you go. So the nationality of the one who leaked it is irrelevant as far as I am concerned.