I want to run some lines of code on creating an organization repository, is it possible to do the same using github actions ? if not then what is the best technique for the same ?
Not certain, but:
I’d expect you could rely on an organization webhook.
You might be able to use a GitHub app or similar.
But functionally, you’ll get an event and then do stuff.