I had exactly the same problem. I created a new repository on GitHub, then a new repository on Docker Hub and connected the GitHub repository to it with the default build rule. I couldn’t get a build to trigger at all, even by manually clicking the “Trigger” button. After staring at the GitHub repository for a while, I realized it had been created with default branch “main”, ignoring the conventional “master”. I fixed the problem by creating a branch called “master” in my GitHub repository.
Most of the blame lies with GitHub for violating a convention which had been in place since the creation of git. If some people want to change the default branch name for their new repositories, GitHub should enable that. I didn’t make such a choice and wasted time because of the extremely surprising change that I had neither been aware of nor consented to.
Some blame also lies with Docker Hub for giving no feedback about the misconfiguration. It looked for a branch named “master” and didn’t find one, then did absolutely nothing. Why notify the user that such a branch doesn’t exist?