Helaili/jekyll-action@v2 fail for "Error: Cannot publish on branch master"

I can’t seem to figure out what’s causing this failure on the build. I haven’t changed anything related to the Github-pages.yml.

All I’ve done is add a custom URL to my page.

log output is:

Configuration file: /github/workspace/_config.yml

[102](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:102) Source: /github/workspace

[103](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:103) Destination: /github/workspace/build

[104](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:104) Incremental build: disabled. Enable with --incremental

[105](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:105) Generating...

[106](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:106) done in 1.168 seconds.

[107](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:107) Auto-regeneration: disabled. Use --watch to enable.

[108](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:108)Jekyll build done

[109](https://github.com/Bryce-Davidson/Bryce-Davidson.github.io/runs/2549551846?check_suite_focus=true#step:4:109)Error: Cannot publish on branch master

Here is a link to the repo:

Hi @Bryce-Davidson, welcome to the GitHub Support Community! It looks like you’ve managed to get your workflows running again by changing the name of your repository and deploying to the gh-pages branch.

You may have been having trouble with this because your workflow was being triggered on pushes to the master branch but then also attempting to deploy to that same branch again. Looking at your previous successful deployments it seems like they were updating the gh-pages branch, but this would not be supported for a username.github.io repository as these need to be hosted from the master or main branch.

You would need to separate your source code into a separate branch—perhaps called develop—and commit any changes there in order to avoid your action inadvertently overwriting your site’s source code, using Actions to then deploy your compiled site to the master or main branch.

It’s likely that actions blocked this from happening due to this step attempting to force push over the top of your workflow files, resulting in a permissions error.