github-pages-auditor 1.2.0__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/PKG-INFO +180 -169
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/README.md +178 -167
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/pyproject.toml +2 -2
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/pyproject.toml.orig +3 -2
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/__init__.py +1 -1
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/LICENSE +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/__main__.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/audit.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/config.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/errors.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/formatters.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/github_api.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/github_web.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/http.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/main.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/models.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/pages.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/pages_health.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/report.py +0 -0
- {github_pages_auditor-1.2.0 → github_pages_auditor-1.2.1}/src/github_pages_auditor/rules.py +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: github-pages-auditor
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Audit every public repo of a GitHub user in one command: Pages health, releases and quality checks. JSON/Markdown output and CI exit codes. Works with or without a token.
|
|
5
5
|
Keywords: github,github-pages,auditor,cli,ci,json,repository-health,portfolio
|
|
6
6
|
Author: Alberto Ortiz
|
|
7
|
-
Author-email: Alberto Ortiz <albertoortixsanchez@gmail.com>
|
|
8
7
|
License-Expression: MIT
|
|
9
8
|
License-File: LICENSE
|
|
10
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
@@ -15,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
18
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
19
|
Classifier: Topic :: Utilities
|
|
20
20
|
Requires-Dist: python-dotenv>=1.0.0
|
|
@@ -31,39 +31,43 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
|
|
32
32
|
# GitHub Profile & Pages Auditor
|
|
33
33
|
|
|
34
|
-
[
|
|
34
|
+
[](https://www.python.org/)
|
|
35
|
+
[](https://pypi.org/project/github-pages-auditor/)
|
|
36
|
+
[](https://github.com/alberto2005-coder/github-pages-auditor/actions/workflows/test.yml)
|
|
37
|
+
[](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/LICENSE)
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
[Español](#español) · [English](#english)
|
|
40
|
+
|
|
41
|
+
> Desarrollado por **[Alberto Ortiz](https://github.com/alberto2005-coder/)** · [albertoortiz.is-a.dev](https://albertoortiz.is-a.dev/)
|
|
37
42
|
|
|
38
43
|
---
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
# Español
|
|
45
|
+
## Español
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
### Índice
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
- [Descripción](#descripción)
|
|
50
|
+
- [Características](#características)
|
|
51
|
+
- [Modos de funcionamiento: con y sin API](#modos-de-funcionamiento-con-y-sin-api)
|
|
52
|
+
- [Requisitos previos](#requisitos-previos)
|
|
53
|
+
- [Instalación](#instalación)
|
|
54
|
+
- [Uso por línea de comandos](#uso-por-línea-de-comandos)
|
|
55
|
+
- [Jerarquía de configuración](#jerarquía-de-configuración)
|
|
56
|
+
- [Códigos de salida](#códigos-de-salida)
|
|
57
|
+
- [Formatos de salida e integración en CI](#formatos-de-salida-e-integración-en-ci)
|
|
58
|
+
- [Pruebas automatizadas](#pruebas-automatizadas)
|
|
59
|
+
- [Estructura del proyecto](#estructura-del-proyecto)
|
|
60
|
+
- [Seguridad](#seguridad)
|
|
61
|
+
- [Autor](#autor)
|
|
62
|
+
- [Licencia](#licencia)
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
### Descripción
|
|
48
65
|
|
|
49
|
-
|
|
50
|
-
2. [Modos de funcionamiento: con y sin API](#modos-es)
|
|
51
|
-
3. [Requisitos previos](#requisitos-previos-es)
|
|
52
|
-
4. [Instalación](#instalación-es)
|
|
53
|
-
5. [Uso por línea de comandos](#uso-es)
|
|
54
|
-
6. [Jerarquía de configuración](#configuración-es)
|
|
55
|
-
7. [Códigos de salida](#salida-es)
|
|
56
|
-
8. [Formatos de salida e integración en CI](#formatos-es)
|
|
57
|
-
9. [Pruebas automatizadas](#pruebas-es)
|
|
58
|
-
10. [Estructura del proyecto](#estructura-es)
|
|
59
|
-
11. [Seguridad](#seguridad-es)
|
|
60
|
-
12. [Autor](#autor-es)
|
|
61
|
-
13. [Licencia](#licencia-es)
|
|
66
|
+
Herramienta de línea de comandos en Python para auditar los repositorios públicos de un usuario de GitHub: mapea los enlaces de **GitHub Pages** (incluido un dominio personalizado), detecta **releases** y evalúa la calidad del repositorio (README, licencia, `.gitignore` y descripción).
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
Se controla **solo con parámetros de consola**: no necesita archivo `.env`. El **token de la API es opcional**: con token usa la API oficial de GitHub; sin token usa un modo web público de «mejor esfuerzo».
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
## Características
|
|
70
|
+
### Características
|
|
67
71
|
|
|
68
72
|
- **Mapeo de GitHub Pages:** raíz (`<usuario>.github.io`) o subruta por repositorio, verificando que la URL responde de verdad.
|
|
69
73
|
- **Releases:** detectadas mediante el feed Atom público, sin consumir cuota de la API.
|
|
@@ -73,8 +77,7 @@ Se controla **solo con parámetros de consola**: no necesita archivo `.env`. El
|
|
|
73
77
|
- **Informe determinista:** los repositorios salen siempre en el mismo orden; un fallo de red en un repo no tumba el resto (se lista aparte).
|
|
74
78
|
- **Créditos del autor** en `--help`, `--version`, la consola y el informe.
|
|
75
79
|
|
|
76
|
-
|
|
77
|
-
## Modos de funcionamiento: con y sin API
|
|
80
|
+
### Modos de funcionamiento: con y sin API
|
|
78
81
|
|
|
79
82
|
| | Con token (`-k` / `GITHUB_TOKEN`) | Sin token |
|
|
80
83
|
| :--- | :--- | :--- |
|
|
@@ -87,22 +90,28 @@ El token **solo se envía a `api.github.com`**.
|
|
|
87
90
|
|
|
88
91
|
**URL de las Pages:** con API se usa la URL real que GitHub tiene configurada (incluido tu dominio personalizado). Sin API, si no indicas `-w`, se prueba `https://<usuario>.github.io/...` y, si GitHub redirige a tu dominio personalizado, se detecta y se muestra ese dominio. Con `-w` se comprueba directamente ese dominio.
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
## Requisitos previos
|
|
93
|
+
### Requisitos previos
|
|
92
94
|
|
|
93
95
|
- **Python** 3.10 o superior.
|
|
94
96
|
- **Gestor de paquetes:** [`uv`](https://docs.astral.sh/uv/) (recomendado) o `pip`.
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
## Instalación
|
|
98
|
+
### Instalación
|
|
98
99
|
|
|
99
100
|
- **Sin instalar nada (recomendado), con [`uv`](https://docs.astral.sh/uv/):**
|
|
101
|
+
|
|
100
102
|
```bash
|
|
101
103
|
uvx github-pages-auditor -u tu_usuario
|
|
102
104
|
```
|
|
103
|
-
- **Instalarlo como comando:** `uv tool install github-pages-auditor` o `pip install github-pages-auditor`.
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
- **Instalarlo globalmente como comando:**
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
uv tool install github-pages-auditor
|
|
110
|
+
# o mediante pip:
|
|
111
|
+
pip install github-pages-auditor
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
El comando antiguo `ver-github-pages` sigue funcionando como alias de compatibilidad.
|
|
106
115
|
|
|
107
116
|
Para desarrollar desde el código fuente:
|
|
108
117
|
|
|
@@ -112,40 +121,45 @@ cd github-pages-auditor
|
|
|
112
121
|
```
|
|
113
122
|
|
|
114
123
|
- **Con `uv` (recomendado):**
|
|
124
|
+
|
|
115
125
|
```bash
|
|
116
126
|
uv sync
|
|
117
127
|
```
|
|
128
|
+
|
|
118
129
|
- **Con `pip`:**
|
|
130
|
+
|
|
119
131
|
```bash
|
|
120
132
|
pip install -e .
|
|
121
133
|
```
|
|
122
134
|
|
|
123
|
-
|
|
124
|
-
## Uso por línea de comandos
|
|
135
|
+
### Uso por línea de comandos
|
|
125
136
|
|
|
126
137
|
```text
|
|
127
138
|
github-pages-auditor -u USUARIO [-w DOMINIO] [-k TOKEN] [-o ARCHIVO] [opciones]
|
|
128
139
|
```
|
|
129
140
|
|
|
130
|
-
**Ejemplos**
|
|
141
|
+
**Ejemplos** *(si ejecutas desde el repositorio sin instalar globalmente, antepón `uv run`)*
|
|
131
142
|
|
|
132
143
|
```bash
|
|
133
144
|
# 1. Básico, sin token ni .env (modo web)
|
|
134
|
-
|
|
145
|
+
github-pages-auditor -u alberto2005-coder
|
|
135
146
|
|
|
136
|
-
# 2. Con dominio personalizado y token (modo API)
|
|
137
|
-
|
|
147
|
+
# 2. Con dominio personalizado y token por variable de entorno (modo API; recomendado)
|
|
148
|
+
export GITHUB_TOKEN=github_pat_xxx # PowerShell: $env:GITHUB_TOKEN = "github_pat_xxx"
|
|
149
|
+
github-pages-auditor -u alberto2005-coder -w https://albertoortiz.is-a.dev
|
|
138
150
|
|
|
139
|
-
# 3. Forzar modo web aunque haya token y cambiar el archivo de salida
|
|
140
|
-
|
|
151
|
+
# 3. Forzar modo web aunque haya token en el entorno y cambiar el archivo de salida
|
|
152
|
+
github-pages-auditor -u alberto2005-coder --no-api -o mi_reporte.txt
|
|
141
153
|
|
|
142
|
-
# 4. Token
|
|
143
|
-
|
|
154
|
+
# 4. Token como parámetro (funciona, pero queda en el historial del shell)
|
|
155
|
+
github-pages-auditor -u alberto2005-coder -k github_pat_xxx
|
|
144
156
|
|
|
145
|
-
# 5. También funciona como módulo
|
|
157
|
+
# 5. También funciona como módulo de Python (útil si Scripts no está en el PATH)
|
|
146
158
|
python -m github_pages_auditor -u alberto2005-coder
|
|
147
159
|
```
|
|
148
160
|
|
|
161
|
+
Un token *fine-grained* sin permisos (solo repositorios públicos) es suficiente.
|
|
162
|
+
|
|
149
163
|
**Opciones**
|
|
150
164
|
|
|
151
165
|
| Parámetro | Alternativas | Descripción | Obligatorio |
|
|
@@ -168,8 +182,7 @@ python -m github_pages_auditor -u alberto2005-coder
|
|
|
168
182
|
| `-V` | `--version` | Versión y créditos | No |
|
|
169
183
|
| `-h` | `--help` | Ayuda y créditos | No |
|
|
170
184
|
|
|
171
|
-
|
|
172
|
-
## Jerarquía de configuración
|
|
185
|
+
### Jerarquía de configuración
|
|
173
186
|
|
|
174
187
|
1. **Parámetros de consola** (`-u`, `-w`, `-k`, `-o`…).
|
|
175
188
|
2. **Variables de entorno**, incluidas las de un archivo `.env` **opcional** en el directorio actual: `USUARIO_GITHUB`, `DOMINIO_WEB`, `GITHUB_TOKEN`, `ARCHIVO_SALIDA`. Un valor vacío se trata como no definido.
|
|
@@ -177,8 +190,7 @@ python -m github_pages_auditor -u alberto2005-coder
|
|
|
177
190
|
|
|
178
191
|
Hay una plantilla en [`.env.example`](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/.env.example).
|
|
179
192
|
|
|
180
|
-
|
|
181
|
-
## Códigos de salida
|
|
193
|
+
### Códigos de salida
|
|
182
194
|
|
|
183
195
|
| Código | Significado |
|
|
184
196
|
| :---: | :--- |
|
|
@@ -188,8 +200,7 @@ Hay una plantilla en [`.env.example`](https://github.com/alberto2005-coder/githu
|
|
|
188
200
|
| `3` | No hay repositorios que analizar (no se escribe informe) |
|
|
189
201
|
| `130` | Cancelado con Ctrl+C |
|
|
190
202
|
|
|
191
|
-
|
|
192
|
-
## Formatos de salida e integración en CI
|
|
203
|
+
### Formatos de salida e integración en CI
|
|
193
204
|
|
|
194
205
|
`-f/--format` elige el formato del informe: `txt` (por defecto), `json` o `md`. Con `-o -` el informe va a la salida estándar y la interfaz a stderr, así que se puede encadenar con otras herramientas:
|
|
195
206
|
|
|
@@ -197,13 +208,15 @@ Hay una plantilla en [`.env.example`](https://github.com/alberto2005-coder/githu
|
|
|
197
208
|
uvx github-pages-auditor -u alberto2005-coder -f json -o - -q | jq '.summary'
|
|
198
209
|
```
|
|
199
210
|
|
|
200
|
-
**JSON** (`schema_version: 1`): `tool`, `generated_at`, `user`, `mode` (`api`/`web`), `summary` (contadores), `findings` (una lista por regla, vacía si no hay hallazgos), `fail_on` (reglas pedidas y disparadas) y `repos` (un objeto por repositorio, con `pages.status`, `pages.problems`, `pages.warnings`, `pages.title`, etc.).
|
|
211
|
+
**JSON** (`schema_version: 1`): `tool`, `generated_at`, `user`, `mode` (`api`/`web`), `domain`, `summary` (contadores), `findings` (una lista por regla, vacía si no hay hallazgos), `fail_on` (reglas pedidas y disparadas) y `repos` (un objeto por repositorio, con `pages.status`, `pages.problems`, `pages.warnings`, `pages.title`, etc.).
|
|
201
212
|
|
|
202
213
|
**Markdown** (`-f md`): tabla de tus demos en vivo, ordenada y sin forks, entre los marcadores `<!-- github-pages-auditor:start -->` y `<!-- github-pages-auditor:end -->`. Con `--inject README.md` se actualiza **dentro de ese archivo**, entre esos marcadores (si no existen, falla sin tocar nada).
|
|
203
214
|
|
|
204
215
|
**Reglas de `--fail-on`:** `missing-readme`, `missing-license`, `missing-gitignore`, `missing-description`, `broken-pages`, `analysis-errors` o `any`. Ejemplo: `--fail-on missing-license,broken-pages`.
|
|
205
216
|
|
|
206
|
-
**Salud de Pages.** Para cada sitio se comprueba, además del código 200: errores TLS, timeouts, redirecciones a otro dominio o en bucle, página vacía o sin HTML, y lentitud (aviso). Con **token** se sabe qué repos tienen Pages activadas, así que un 404, un build fallido (`errored`) o cualquier fallo cuenta como **Pages rotas**. Sin token no se puede saber si un repo *debería* tener Pages, por lo que un fallo solo significa
|
|
217
|
+
**Salud de Pages.** Para cada sitio se comprueba, además del código 200: errores TLS, timeouts, redirecciones a otro dominio o en bucle, página vacía o sin HTML, y lentitud (aviso). Con **token** se sabe qué repos tienen Pages activadas, así que un 404, un build fallido (`errored`) o cualquier fallo cuenta como **Pages rotas**. Sin token no se puede saber si un repo *debería* tener Pages, por lo que un fallo solo significa «no hay Pages».
|
|
218
|
+
|
|
219
|
+
Contrato completo del JSON: [docs/json-schema.md](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/docs/json-schema.md). Más recetas de CI (resumen del job, refresco semanal del README): [docs/ci.md](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/docs/ci.md).
|
|
207
220
|
|
|
208
221
|
**Ejemplo de CI (GitHub Actions):**
|
|
209
222
|
|
|
@@ -211,8 +224,7 @@ uvx github-pages-auditor -u alberto2005-coder -f json -o - -q | jq '.summary'
|
|
|
211
224
|
- run: uvx github-pages-auditor -u ${{ github.repository_owner }} -k ${{ secrets.GITHUB_TOKEN }} -f json -o report.json --fail-on missing-license,broken-pages
|
|
212
225
|
```
|
|
213
226
|
|
|
214
|
-
|
|
215
|
-
## Pruebas automatizadas
|
|
227
|
+
### Pruebas automatizadas
|
|
216
228
|
|
|
217
229
|
Los tests usan una sesión HTTP falsa: no tocan la red ni consumen cuota de GitHub.
|
|
218
230
|
|
|
@@ -220,103 +232,97 @@ Los tests usan una sesión HTTP falsa: no tocan la red ni consumen cuota de GitH
|
|
|
220
232
|
uv run pytest # o: pip install -r requirements-dev.txt && pytest
|
|
221
233
|
```
|
|
222
234
|
|
|
223
|
-
Cubren configuración y prioridades, cliente HTTP, ambos proveedores (API y web), orquestación en paralelo, informe, CLI, códigos de salida y créditos. La integración continua (GitHub Actions) los ejecuta en Linux, macOS y Windows con Python 3.10 y 3.
|
|
235
|
+
Cubren configuración y prioridades, cliente HTTP, ambos proveedores (API y web), orquestación en paralelo, informe, CLI, códigos de salida y créditos. La integración continua (GitHub Actions) los ejecuta en Linux, macOS y Windows con Python 3.10, 3.13 y 3.14.
|
|
224
236
|
|
|
225
|
-
|
|
226
|
-
## Estructura del proyecto
|
|
237
|
+
### Estructura del proyecto
|
|
227
238
|
|
|
228
239
|
```text
|
|
229
240
|
github-pages-auditor/
|
|
230
|
-
├── .github/workflows/test.yml
|
|
241
|
+
├── .github/workflows/test.yml # Integración continua
|
|
231
242
|
├── .github/workflows/publish.yml # Publicación en PyPI
|
|
232
|
-
├── .env.example
|
|
243
|
+
├── .env.example # Plantilla opcional de variables
|
|
233
244
|
├── .gitignore
|
|
234
|
-
├── CHANGELOG.md
|
|
245
|
+
├── CHANGELOG.md # Historial de versiones
|
|
235
246
|
├── LICENSE
|
|
236
247
|
├── README.md
|
|
237
248
|
├── pyproject.toml
|
|
238
|
-
├── requirements.txt
|
|
239
|
-
├── requirements-dev.txt
|
|
249
|
+
├── requirements.txt # Dependencias para pip
|
|
250
|
+
├── requirements-dev.txt # + pytest
|
|
240
251
|
├── uv.lock
|
|
241
252
|
├── src/github_pages_auditor/
|
|
242
|
-
│ ├── __init__.py
|
|
243
|
-
│ ├── __main__.py
|
|
244
|
-
│ ├── main.py
|
|
245
|
-
│ ├── config.py
|
|
246
|
-
│ ├── audit.py
|
|
247
|
-
│ ├── github_api.py
|
|
248
|
-
│ ├── github_web.py
|
|
249
|
-
│ ├── http.py
|
|
250
|
-
│ ├── pages.py
|
|
251
|
-
│ ├── pages_health.py
|
|
252
|
-
│ ├── rules.py
|
|
253
|
-
│ ├── formatters.py
|
|
254
|
-
│ ├── models.py
|
|
255
|
-
│ ├── errors.py
|
|
256
|
-
│ └── report.py
|
|
257
|
-
└── tests/
|
|
253
|
+
│ ├── __init__.py # Versión y créditos del autor
|
|
254
|
+
│ ├── __main__.py # python -m github_pages_auditor
|
|
255
|
+
│ ├── main.py # Punto de entrada de la CLI
|
|
256
|
+
│ ├── config.py # Argumentos y entorno
|
|
257
|
+
│ ├── audit.py # Orquestación en paralelo
|
|
258
|
+
│ ├── github_api.py # Proveedor: API oficial (con token)
|
|
259
|
+
│ ├── github_web.py # Proveedor: web pública (sin token)
|
|
260
|
+
│ ├── http.py # Sesión con reintentos y timeout
|
|
261
|
+
│ ├── pages.py # URLs de GitHub Pages
|
|
262
|
+
│ ├── pages_health.py # Salud de Pages (404, TLS, redirecciones...)
|
|
263
|
+
│ ├── rules.py # Reglas de --fail-on
|
|
264
|
+
│ ├── formatters.py # Salidas JSON y Markdown
|
|
265
|
+
│ ├── models.py # Estructuras de datos
|
|
266
|
+
│ ├── errors.py # Excepciones propias
|
|
267
|
+
│ └── report.py # Consola (Rich) e informe .txt
|
|
268
|
+
└── tests/ # Suite de pytest
|
|
258
269
|
```
|
|
259
270
|
|
|
260
|
-
|
|
261
|
-
## Seguridad
|
|
271
|
+
### Seguridad
|
|
262
272
|
|
|
263
273
|
- El token se envía **únicamente** a `api.github.com`, nunca a `github.com`, `raw.githubusercontent.com` ni a tu dominio.
|
|
264
274
|
- Un parámetro `-k` queda en el historial del shell: es preferible la variable `GITHUB_TOKEN`.
|
|
265
275
|
- No subas tu `.env` a git (ya está en `.gitignore`). Para esta herramienta basta un token sin permisos especiales (repos públicos).
|
|
266
276
|
|
|
267
|
-
|
|
268
|
-
## Autor
|
|
277
|
+
### Autor
|
|
269
278
|
|
|
270
279
|
Desarrollado por **Alberto Ortiz**.
|
|
271
280
|
|
|
272
281
|
- GitHub: <https://github.com/alberto2005-coder/>
|
|
273
282
|
- Web personal: <https://albertoortiz.is-a.dev/>
|
|
274
283
|
|
|
275
|
-
|
|
276
|
-
## Licencia
|
|
284
|
+
### Licencia
|
|
277
285
|
|
|
278
|
-
Distribuido bajo la Licencia MIT
|
|
286
|
+
Distribuido bajo la **Licencia MIT**. Consulta [LICENSE](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/LICENSE). © 2026 Alberto Ortiz.
|
|
279
287
|
|
|
280
288
|
---
|
|
281
289
|
|
|
282
|
-
|
|
283
|
-
# English
|
|
290
|
+
## English
|
|
284
291
|
|
|
285
|
-
|
|
292
|
+
### Table of contents
|
|
286
293
|
|
|
287
|
-
|
|
294
|
+
- [Overview](#overview)
|
|
295
|
+
- [Features](#features)
|
|
296
|
+
- [Operating modes: with and without API](#operating-modes-with-and-without-api)
|
|
297
|
+
- [Prerequisites](#prerequisites)
|
|
298
|
+
- [Installation](#installation)
|
|
299
|
+
- [Command-line usage](#command-line-usage)
|
|
300
|
+
- [Configuration precedence](#configuration-precedence)
|
|
301
|
+
- [Exit codes](#exit-codes)
|
|
302
|
+
- [Output formats and CI integration](#output-formats-and-ci-integration)
|
|
303
|
+
- [Automated tests](#automated-tests)
|
|
304
|
+
- [Project structure](#project-structure)
|
|
305
|
+
- [Security](#security)
|
|
306
|
+
- [Author](#author)
|
|
307
|
+
- [License](#license)
|
|
288
308
|
|
|
289
|
-
|
|
309
|
+
### Overview
|
|
290
310
|
|
|
291
|
-
|
|
292
|
-
2. [Operating modes: with and without API](#modes-en)
|
|
293
|
-
3. [Prerequisites](#prerequisites-en)
|
|
294
|
-
4. [Installation](#installation-en)
|
|
295
|
-
5. [Command-line usage](#usage-en)
|
|
296
|
-
6. [Configuration precedence](#configuration-en)
|
|
297
|
-
7. [Exit codes](#exit-en)
|
|
298
|
-
8. [Output formats and CI integration](#formats-en)
|
|
299
|
-
9. [Automated tests](#tests-en)
|
|
300
|
-
10. [Project structure](#structure-en)
|
|
301
|
-
11. [Security](#security-en)
|
|
302
|
-
12. [Author](#author-en)
|
|
303
|
-
13. [License](#license-en)
|
|
311
|
+
A Python command-line tool that audits a GitHub user's public repositories: it maps **GitHub Pages** links (including a custom domain), detects **releases**, and checks repository quality (README, licence, `.gitignore` and description).
|
|
304
312
|
|
|
305
|
-
|
|
313
|
+
It is driven **entirely by command-line parameters**: no `.env` file is needed. The **API token is optional**: with a token it uses the official GitHub API; without one it falls back to a best-effort public web mode.
|
|
306
314
|
|
|
307
|
-
|
|
308
|
-
## Features
|
|
315
|
+
### Features
|
|
309
316
|
|
|
310
317
|
- **GitHub Pages mapping:** root (`<user>.github.io`) or per-repository subpath, verifying that the URL really responds.
|
|
311
318
|
- **Releases:** detected through the public Atom feed, without using API quota.
|
|
312
|
-
- **Quality audit:** missing README,
|
|
319
|
+
- **Quality audit:** missing README, licence, `.gitignore` and description (About).
|
|
313
320
|
- **Classification:** forks and archived repositories.
|
|
314
321
|
- **Performance:** all checks run in parallel (`ThreadPoolExecutor`) with retries and timeouts.
|
|
315
322
|
- **Deterministic report:** repositories always appear in the same order; a network failure on one repo does not abort the rest (it is listed separately).
|
|
316
323
|
- **Author credits** in `--help`, `--version`, the console and the report.
|
|
317
324
|
|
|
318
|
-
|
|
319
|
-
## Operating modes: with and without API
|
|
325
|
+
### Operating modes: with and without API
|
|
320
326
|
|
|
321
327
|
| | With token (`-k` / `GITHUB_TOKEN`) | Without token |
|
|
322
328
|
| :--- | :--- | :--- |
|
|
@@ -329,22 +335,28 @@ The token is **only ever sent to `api.github.com`**.
|
|
|
329
335
|
|
|
330
336
|
**Pages URL:** with the API, the real URL configured on GitHub is used (including your custom domain). Without the API and without `-w`, `https://<user>.github.io/...` is tried and, if GitHub redirects to your custom domain, that domain is detected and shown. With `-w`, that domain is checked directly.
|
|
331
337
|
|
|
332
|
-
|
|
333
|
-
## Prerequisites
|
|
338
|
+
### Prerequisites
|
|
334
339
|
|
|
335
340
|
- **Python** 3.10 or higher.
|
|
336
341
|
- **Package manager:** [`uv`](https://docs.astral.sh/uv/) (recommended) or `pip`.
|
|
337
342
|
|
|
338
|
-
|
|
339
|
-
## Installation
|
|
343
|
+
### Installation
|
|
340
344
|
|
|
341
345
|
- **Without installing anything (recommended), with [`uv`](https://docs.astral.sh/uv/):**
|
|
346
|
+
|
|
342
347
|
```bash
|
|
343
348
|
uvx github-pages-auditor -u your_user
|
|
344
349
|
```
|
|
345
|
-
- **Install it as a command:** `uv tool install github-pages-auditor` or `pip install github-pages-auditor`.
|
|
346
350
|
|
|
347
|
-
|
|
351
|
+
- **Install it globally as a command:**
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
uv tool install github-pages-auditor
|
|
355
|
+
# or via pip:
|
|
356
|
+
pip install github-pages-auditor
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
The old `ver-github-pages` command keeps working as a compatibility alias.
|
|
348
360
|
|
|
349
361
|
To work from source:
|
|
350
362
|
|
|
@@ -354,40 +366,45 @@ cd github-pages-auditor
|
|
|
354
366
|
```
|
|
355
367
|
|
|
356
368
|
- **Using `uv` (recommended):**
|
|
369
|
+
|
|
357
370
|
```bash
|
|
358
371
|
uv sync
|
|
359
372
|
```
|
|
373
|
+
|
|
360
374
|
- **Using `pip`:**
|
|
375
|
+
|
|
361
376
|
```bash
|
|
362
377
|
pip install -e .
|
|
363
378
|
```
|
|
364
379
|
|
|
365
|
-
|
|
366
|
-
## Command-line usage
|
|
380
|
+
### Command-line usage
|
|
367
381
|
|
|
368
382
|
```text
|
|
369
383
|
github-pages-auditor -u USER [-w DOMAIN] [-k TOKEN] [-o FILE] [options]
|
|
370
384
|
```
|
|
371
385
|
|
|
372
|
-
**Examples**
|
|
386
|
+
**Examples** *(if running from source without a global install, prefix with `uv run`)*
|
|
373
387
|
|
|
374
388
|
```bash
|
|
375
389
|
# 1. Basic, no token and no .env (web mode)
|
|
376
|
-
|
|
390
|
+
github-pages-auditor -u alberto2005-coder
|
|
377
391
|
|
|
378
|
-
# 2. Custom domain and token (API mode)
|
|
379
|
-
|
|
392
|
+
# 2. Custom domain and token from an environment variable (API mode; recommended)
|
|
393
|
+
export GITHUB_TOKEN=github_pat_xxx # PowerShell: $env:GITHUB_TOKEN = "github_pat_xxx"
|
|
394
|
+
github-pages-auditor -u alberto2005-coder -w https://albertoortiz.is-a.dev
|
|
380
395
|
|
|
381
|
-
# 3. Force web mode even with a token, and change the output file
|
|
382
|
-
|
|
396
|
+
# 3. Force web mode even with a token in the environment, and change the output file
|
|
397
|
+
github-pages-auditor -u alberto2005-coder --no-api -o my_report.txt
|
|
383
398
|
|
|
384
|
-
# 4. Token
|
|
385
|
-
|
|
399
|
+
# 4. Token as a parameter (works, but it stays in your shell history)
|
|
400
|
+
github-pages-auditor -u alberto2005-coder -k github_pat_xxx
|
|
386
401
|
|
|
387
|
-
# 5. Also works as a module
|
|
402
|
+
# 5. Also works as a Python module (useful if Scripts is not on PATH)
|
|
388
403
|
python -m github_pages_auditor -u alberto2005-coder
|
|
389
404
|
```
|
|
390
405
|
|
|
406
|
+
A fine-grained token with no permissions (public repositories only) is enough.
|
|
407
|
+
|
|
391
408
|
**Options**
|
|
392
409
|
|
|
393
410
|
| Flag | Aliases | Description | Required |
|
|
@@ -405,13 +422,12 @@ python -m github_pages_auditor -u alberto2005-coder
|
|
|
405
422
|
| `--workers` | | Parallel threads | No (default `15`) |
|
|
406
423
|
| `--timeout` | | Per-request timeout, in seconds | No (default `10`) |
|
|
407
424
|
| `--no-api` | | Force web mode even with a token | No |
|
|
408
|
-
| `--no-color` | |
|
|
425
|
+
| `--no-color` | | Colourless console output | No |
|
|
409
426
|
| `--no-env` | | Do not read the `.env` file | No |
|
|
410
427
|
| `-V` | `--version` | Version and credits | No |
|
|
411
428
|
| `-h` | `--help` | Help and credits | No |
|
|
412
429
|
|
|
413
|
-
|
|
414
|
-
## Configuration precedence
|
|
430
|
+
### Configuration precedence
|
|
415
431
|
|
|
416
432
|
1. **Command-line parameters** (`-u`, `-w`, `-k`, `-o`…).
|
|
417
433
|
2. **Environment variables**, including those from an **optional** `.env` file in the current directory: `USUARIO_GITHUB`, `DOMINIO_WEB`, `GITHUB_TOKEN`, `ARCHIVO_SALIDA`. An empty value counts as unset.
|
|
@@ -419,19 +435,17 @@ python -m github_pages_auditor -u alberto2005-coder
|
|
|
419
435
|
|
|
420
436
|
A template is provided in [`.env.example`](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/.env.example).
|
|
421
437
|
|
|
422
|
-
|
|
423
|
-
## Exit codes
|
|
438
|
+
### Exit codes
|
|
424
439
|
|
|
425
440
|
| Code | Meaning |
|
|
426
441
|
| :---: | :--- |
|
|
427
442
|
| `0` | Audit succeeded and report written |
|
|
428
443
|
| `1` | A `--fail-on` rule found issues (the report is still written) |
|
|
429
444
|
| `2` | Error: invalid parameters, unknown user, rejected token, rate limit, network or write failure |
|
|
430
|
-
| `3` | No repositories to
|
|
445
|
+
| `3` | No repositories to analyse (no report is written) |
|
|
431
446
|
| `130` | Cancelled with Ctrl+C |
|
|
432
447
|
|
|
433
|
-
|
|
434
|
-
## Output formats and CI integration
|
|
448
|
+
### Output formats and CI integration
|
|
435
449
|
|
|
436
450
|
`-f/--format` selects the report format: `txt` (default), `json` or `md`. With `-o -` the report goes to standard output and the UI to stderr, so it can be piped:
|
|
437
451
|
|
|
@@ -439,13 +453,15 @@ A template is provided in [`.env.example`](https://github.com/alberto2005-coder/
|
|
|
439
453
|
uvx github-pages-auditor -u alberto2005-coder -f json -o - -q | jq '.summary'
|
|
440
454
|
```
|
|
441
455
|
|
|
442
|
-
**JSON** (`schema_version: 1`): `tool`, `generated_at`, `user`, `mode` (`api`/`web`), `summary` (counters), `findings` (one list per rule, empty when clean), `fail_on` (requested and triggered rules) and `repos` (one object per repository, with `pages.status`, `pages.problems`, `pages.warnings`, `pages.title`, etc.).
|
|
456
|
+
**JSON** (`schema_version: 1`): `tool`, `generated_at`, `user`, `mode` (`api`/`web`), `domain`, `summary` (counters), `findings` (one list per rule, empty when clean), `fail_on` (requested and triggered rules) and `repos` (one object per repository, with `pages.status`, `pages.problems`, `pages.warnings`, `pages.title`, etc.).
|
|
443
457
|
|
|
444
458
|
**Markdown** (`-f md`): a sorted table of your live demos, forks excluded, between the `<!-- github-pages-auditor:start -->` and `<!-- github-pages-auditor:end -->` markers. `--inject README.md` updates it **inside that file**, between those markers (if they are missing it fails without touching anything).
|
|
445
459
|
|
|
446
460
|
**`--fail-on` rules:** `missing-readme`, `missing-license`, `missing-gitignore`, `missing-description`, `broken-pages`, `analysis-errors` or `any`. Example: `--fail-on missing-license,broken-pages`.
|
|
447
461
|
|
|
448
|
-
**Pages health.** Besides a 200 status, each site is checked for TLS errors, timeouts, redirects to another domain or loops, empty or non-HTML pages, and slowness (warning). With a **token** the tool knows which repos have Pages enabled, so a 404, a failed build (`errored`) or any failure counts as **broken Pages**. Without a token it cannot know whether a repo *should* have Pages, so a failure just means
|
|
462
|
+
**Pages health.** Besides a 200 status, each site is checked for TLS errors, timeouts, redirects to another domain or loops, empty or non-HTML pages, and slowness (warning). With a **token** the tool knows which repos have Pages enabled, so a 404, a failed build (`errored`) or any failure counts as **broken Pages**. Without a token it cannot know whether a repo *should* have Pages, so a failure just means “no Pages”.
|
|
463
|
+
|
|
464
|
+
Full JSON contract: [docs/json-schema.md](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/docs/json-schema.md). More CI recipes (job summary, weekly README refresh): [docs/ci.md](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/docs/ci.md).
|
|
449
465
|
|
|
450
466
|
**CI example (GitHub Actions):**
|
|
451
467
|
|
|
@@ -453,8 +469,7 @@ uvx github-pages-auditor -u alberto2005-coder -f json -o - -q | jq '.summary'
|
|
|
453
469
|
- run: uvx github-pages-auditor -u ${{ github.repository_owner }} -k ${{ secrets.GITHUB_TOKEN }} -f json -o report.json --fail-on missing-license,broken-pages
|
|
454
470
|
```
|
|
455
471
|
|
|
456
|
-
|
|
457
|
-
## Automated tests
|
|
472
|
+
### Automated tests
|
|
458
473
|
|
|
459
474
|
Tests use a fake HTTP session: they never touch the network or use GitHub quota.
|
|
460
475
|
|
|
@@ -462,59 +477,55 @@ Tests use a fake HTTP session: they never touch the network or use GitHub quota.
|
|
|
462
477
|
uv run pytest # or: pip install -r requirements-dev.txt && pytest
|
|
463
478
|
```
|
|
464
479
|
|
|
465
|
-
They cover configuration and precedence, the HTTP client, both providers (API and web), parallel orchestration, the report, the CLI, exit codes and credits. Continuous integration (GitHub Actions) runs them on Linux, macOS and Windows with Python 3.10 and 3.
|
|
480
|
+
They cover configuration and precedence, the HTTP client, both providers (API and web), parallel orchestration, the report, the CLI, exit codes and credits. Continuous integration (GitHub Actions) runs them on Linux, macOS and Windows with Python 3.10, 3.13 and 3.14.
|
|
466
481
|
|
|
467
|
-
|
|
468
|
-
## Project structure
|
|
482
|
+
### Project structure
|
|
469
483
|
|
|
470
484
|
```text
|
|
471
485
|
github-pages-auditor/
|
|
472
|
-
├── .github/workflows/test.yml
|
|
486
|
+
├── .github/workflows/test.yml # Continuous integration
|
|
473
487
|
├── .github/workflows/publish.yml # PyPI publishing
|
|
474
|
-
├── .env.example
|
|
488
|
+
├── .env.example # Optional variables template
|
|
475
489
|
├── .gitignore
|
|
476
|
-
├── CHANGELOG.md
|
|
490
|
+
├── CHANGELOG.md # Version history
|
|
477
491
|
├── LICENSE
|
|
478
492
|
├── README.md
|
|
479
493
|
├── pyproject.toml
|
|
480
|
-
├── requirements.txt
|
|
481
|
-
├── requirements-dev.txt
|
|
494
|
+
├── requirements.txt # pip dependencies
|
|
495
|
+
├── requirements-dev.txt # + pytest
|
|
482
496
|
├── uv.lock
|
|
483
497
|
├── src/github_pages_auditor/
|
|
484
|
-
│ ├── __init__.py
|
|
485
|
-
│ ├── __main__.py
|
|
486
|
-
│ ├── main.py
|
|
487
|
-
│ ├── config.py
|
|
488
|
-
│ ├── audit.py
|
|
489
|
-
│ ├── github_api.py
|
|
490
|
-
│ ├── github_web.py
|
|
491
|
-
│ ├── http.py
|
|
492
|
-
│ ├── pages.py
|
|
493
|
-
│ ├── pages_health.py
|
|
494
|
-
│ ├── rules.py
|
|
495
|
-
│ ├── formatters.py
|
|
496
|
-
│ ├── models.py
|
|
497
|
-
│ ├── errors.py
|
|
498
|
-
│ └── report.py
|
|
499
|
-
└── tests/
|
|
498
|
+
│ ├── __init__.py # Version and author credits
|
|
499
|
+
│ ├── __main__.py # python -m github_pages_auditor
|
|
500
|
+
│ ├── main.py # CLI entry point
|
|
501
|
+
│ ├── config.py # Arguments and environment
|
|
502
|
+
│ ├── audit.py # Parallel orchestration
|
|
503
|
+
│ ├── github_api.py # Provider: official API (with token)
|
|
504
|
+
│ ├── github_web.py # Provider: public web (no token)
|
|
505
|
+
│ ├── http.py # Session with retries and timeout
|
|
506
|
+
│ ├── pages.py # GitHub Pages URLs
|
|
507
|
+
│ ├── pages_health.py # Pages health (404, TLS, redirects...)
|
|
508
|
+
│ ├── rules.py # --fail-on rules
|
|
509
|
+
│ ├── formatters.py # JSON and Markdown output
|
|
510
|
+
│ ├── models.py # Data structures
|
|
511
|
+
│ ├── errors.py # Custom exceptions
|
|
512
|
+
│ └── report.py # Console (Rich) and .txt report
|
|
513
|
+
└── tests/ # pytest suite
|
|
500
514
|
```
|
|
501
515
|
|
|
502
|
-
|
|
503
|
-
## Security
|
|
516
|
+
### Security
|
|
504
517
|
|
|
505
518
|
- The token is sent **only** to `api.github.com`, never to `github.com`, `raw.githubusercontent.com` or your own domain.
|
|
506
519
|
- A `-k` parameter is stored in your shell history: prefer the `GITHUB_TOKEN` environment variable.
|
|
507
520
|
- Do not commit your `.env` (it is already in `.gitignore`). A token with no special scopes (public repos) is enough for this tool.
|
|
508
521
|
|
|
509
|
-
|
|
510
|
-
## Author
|
|
522
|
+
### Author
|
|
511
523
|
|
|
512
524
|
Developed by **Alberto Ortiz**.
|
|
513
525
|
|
|
514
526
|
- GitHub: <https://github.com/alberto2005-coder/>
|
|
515
527
|
- Personal website: <https://albertoortiz.is-a.dev/>
|
|
516
528
|
|
|
517
|
-
|
|
518
|
-
## License
|
|
529
|
+
### License
|
|
519
530
|
|
|
520
|
-
Distributed under the MIT License
|
|
531
|
+
Distributed under the **MIT License**. See [LICENSE](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/LICENSE). © 2026 Alberto Ortiz.
|