Refactorio / FactorioWebInterface

MIT License
0 stars 6 forks source link

Webhook: Pass repository name as argument #29

Closed mheguy closed 4 years ago

mheguy commented 5 years ago

I would like to use the same payload URL for updating backend scripts (and one day the server) automatically.

I know there's a repository.name property in the JSON payload, and I would have given it a shot if you were deserializing the JSON, but I'm not sure how to find which substring it is or anything like that, so instead I'm opening this issue. :)

grilledham commented 5 years ago

I do deserialize the JSON. The class is https://github.com/Refactorio/FactorioWebInterface/blob/develop/FactorioWebInterface/Data/GitHub/PushEvent.cs In this case I think you are after Repository.Name So something like this

var push = data.ToObject<PushEvent>();
string name = push.Repository.Name;
mheguy commented 5 years ago

Ah, guess I totally misunderstood the code. Lol.