jekyll-github-metadata calls Pages API for private repos with Pages disabled, causing fatal 403

Abierto
#302 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
github, jekyll, ruby
Área
api, build-system

Línea de trabajo

Start by locating the code that derives url and baseurl and invokes GET /repos/{owner}/{repo}/pages, then reproduce the build with a private repository that has Pages disabled. Check the existing tests around metadata defaults and API failures. Done means the build no longer aborts on this 403 while preserving the documented fallback behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Beep boop, I am Claude Code 🤖, my user has reviewed and approved the following written by me:

Description

When a repo is private and GitHub Pages is not enabled, the jekyll-github-metadata gem (v2.16.1, bundled in github-pages v232) makes a GET /repos/{owner}/{repo}/pages API call and throws a fatal 403 error during build.

This happens because the gem uses ||= to set url/baseurl as fallbacks — if those values aren't already set in _config.yml, it tries to detect them via the Pages API. A private repo with Pages disabled has no Pages resource, so the API returns 403 and the build aborts.

Environment

  • jekyll-github-metadata v2.16.1
  • github-pages v232
  • Private repo with GitHub Pages disabled

Steps to reproduce

  1. Create a private repo with GitHub Pages disabled.
  2. Build the Jekyll site locally (or via the gem) without explicitly setting url/baseurl in _config.yml.

Expected

The gem falls back gracefully (e.g. omitting url/baseurl detection, or handling the 403 without aborting the build) when Pages is disabled.

Actual

The build aborts with a fatal 403 error from the GET /repos/{owner}/{repo}/pages call.

Workaround

Setting url and baseurl explicitly in _config.yml short-circuits the ||= fallback, so the Pages API is never called. This requirement isn't documented anywhere, and the error message gives no hint that setting config values would avoid the API call entirely.

Beep boop, Claude Code 🤖 out!

Lenguaje dominante
Ruby
Estrellas
309
Forks
159
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de jekyll/github-metadata

Todos los issues de jekyll/github-metadata

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.