Skip to content

Add --upload for generated HTML in GitHub repositories - #1

Merged
asafmor merged 1 commit into
mainfrom
feat/github-upload
Sep 12, 2026
Merged

asafmor merged 1 commit into
mainfrom
feat/github-upload

Conversation

@asafmor

@asafmor asafmor commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Pageleaf can now publish its generated HTML to an existing GitHub repository with --upload [owner/]repo. For example, pageleaf ./docs --upload pages commits docs.html to the root of the signed-in user's pages repository on its default branch, replacing an existing file. An explicit owner such as --upload my-org/pages selects that account or organization.

The upload uses gh for GitHub identity and repository access, and Git with a temporary bare repository for the commit and normal push. It preserves unrelated files, supports empty repositories, skips identical content, and uses the signed-in user's GitHub noreply identity. Remote replacement is automatic; --force retains its existing local-output meaning.

Failures explain the next steps for missing tools, authentication, repository access, directory collisions, local I/O, network issues, and rejected pushes. The generated HTML remains available after a failed upload. Missing repositories are not created automatically, and GitHub Pages is not configured.

Validation:

  • All 28 local tests pass, including real local Git insert/overwrite/no-op, empty repository, symlink, directory collision, concurrent push, and failure scenarios.
  • Live CLI insert, overwrite, and unchanged-content checks passed against asafmor/pages using both owner forms. Uploaded bytes matched the generated file and unrelated entries remained unchanged. The temporary HTML was removed with a follow-up Git commit, restoring the original root tree.
  • Package dry-run includes both new library modules.
  • Added PR CI for Node 20, 22, and 24 on Linux, plus Node 24 on Windows and macOS, including package dry-run checks.

@asafmor
asafmor merged commit 49cdfb0 into main Sep 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant