I would recommend switching to their Events API. Webhooks are great until they aren’t. Querying the Events API means you are able to resume if GitHub, your network or your Raspberry Pi was down.
And bonus, your pi doesn’t need to be exposed to the world.
Learned this one the hard way. Events are definitely the way to go. You can guarantee perfect synchronization of state if you use it carefully (i.e. as a log you replay as needed).
And bonus, your pi doesn’t need to be exposed to the world.