scripts/github: refactor