martinthomson / i-d-template

A template for IETF internet draft git repositories
Other
204 stars 180 forks source link

The `gh-pages` Branch Is Not Created #414

Closed commonsensesoftware closed 8 months ago

commonsensesoftware commented 8 months ago

It's not entirely clear, but it seems the gh-pages branch is supposed to be created automatically. I created a new repo from the template, but when the GH action is run, it fails while running Update GitHub Pages:

make: '.targets.mk' is up to date.
git fetch -qf origin gh-pages:gh-pages
fatal: couldn't find remote ref gh-pages
make: [lib/ghpages.mk:56: fetch-ghpages] Error 12[8](https://github.com/commonsensesoftware/partial-content-uploads/actions/runs/6779688599/job/18427135640#step:7:9) (ignored)
make: *** [lib/ghpages.mk:61: /tmp/ghpages41] Error 1
Error: No gh-pages branch, run `make -f lib/setup.mk setup-ghpages` to initialize it.

From what I can tell of the scripts, the action is supposed to initialize the branch if it doesn't exist. I realize I can manually create the branch, but that seems to defeat the point of the automation. Perhaps I've missed something. I'd like to confirm if I'm missing something or if this is an expected behavior. I'm in a holding pattern to help verify. I didn't see any documentation about having to manually initialize things.

GH Pages are enabled in my account, but I'm using the individual repo approach. Things work perfectly in other repos so I know it's just an issue with the branch not existing.

Thanks in advance for the assistance.

martinthomson commented 8 months ago

There is step at the point you create a repository where you need to check a box to copy all branches from the template into your repository. You probably skipped that step by accident. To fix this, you need to create a branch called "gh-pages".

I normally use the command-line and something like:

git checkout --orphan gh-pages
git rm -rf .
echo /lib/ > .gitignore
git add .gitignore
git commit -am "clean gh-pages branch"
git push origin gh-pages
commonsensesoftware commented 8 months ago

Thanks for the quick reply. I did RTFM. I promise. I don't know how I missed the checkbox. The manual changes did the trick.

martinthomson commented 8 months ago

It is easy to miss. And slightly annoying to patch, but at least it is recoverable.