Creating AWS CodePipeline fails setting up GitHub webhook

I have resolved my issue. It turned out to be a permissions problem in the end: my user wasn’t an Admin on the repo I was trying to add the hook to. You can learn more in the GitHub issue.