Skip to content

fix: handle missing git repo gracefully in github-metadata plugin#127

Merged
osteele merged 1 commit into
mainfrom
fix-github-metadata-panic
Feb 28, 2026
Merged

fix: handle missing git repo gracefully in github-metadata plugin#127
osteele merged 1 commit into
mainfrom
fix-github-metadata-panic

Conversation

@osteele
Copy link
Copy Markdown
Owner

@osteele osteele commented Feb 27, 2026

Summary

  • The jekyll-github-metadata plugin previously panicked when it couldn't determine the current repository (e.g. when the site source isn't a git repo, or has no GitHub remote)
  • Now it logs a warning and continues the build without GitHub metadata, instead of crashing

What changed

plugins/github_metadata.go: Both getCurrentRepo and getGitHubRepo errors are now caught, logged as warnings, and the plugin returns nil to allow the build to proceed.

Repro

Before this fix, building a site that uses github-pages plugin from a non-git directory (e.g. a tarball download) caused a panic:

panic: site drop initialization failed: running plugin: exit status 128

After this fix:

jekyll-github-metadata: can't determine current repository: exit status 128
wrote 151 files in 1.06s.

Test plan

  • go test ./... — all tests pass
  • Build sd17spring.github.io from tarball (no .git directory) — warns and builds 151 files
  • Existing sites with proper git remotes continue to work as before

@osteele osteele merged commit f975f30 into main Feb 28, 2026
6 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