Include/ignore patterns are matched against the GitHub API URL instead of the repository-relative path
@strawberry-little-bear ya está trabajando en esto.
Desde el 22/10/2026.
- #216 de @strawberry-little-bear — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Start in src/bot.ts and trace how changed file paths are passed to matchPatterns for include and ignore rules. Compare that input with file.filename, which the issue says is already used for IGNORE; confirm the behavior with the reproduction in the issue. Done means patterns are matched against repository-relative filenames, so API URL segments cannot affect filtering.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
INCLUDE_PATTERNS and IGNORE_PATTERNS are matched against the pathname of GitHub's contents_url, rather than the repository-relative file path. That pathname includes API metadata:
/repos/{owner}/{repo}/contents/{path}
Consequently, a pattern can accidentally match the owner or repository name. For example, in a repository named docs, with this changed file:
filename: src/app.ts
contents_url: https://api.github.com/repos/example/docs/contents/src/app.ts
and this configuration:
INCLUDE_PATTERNS: docs/**
the current code constructs **/docs/** and matches /repos/example/docs/contents/src/app.ts, so src/app.ts is reviewed even though it is not under a top-level docs/ directory. The same collision means IGNORE_PATTERNS: docs/** can ignore every changed file in a repository named docs.
Expected behavior
Include/ignore patterns should be evaluated against the repository-relative filename (file.filename, which is already used for IGNORE), so API path segments such as repos, the owner, the repository name, and contents cannot participate in matching.
Reproduction
I reproduced the behavior with the project's matchPatterns logic and [email protected]:
minimatch(
'/repos/example/docs/contents/src/app.ts',
'**/docs/**'
); // true
The expected input for this file is instead:
minimatch('src/app.ts', '**/docs/**'); // false
The relevant code is in src/bot.ts, where decodeURIComponent(new URL(file.contents_url).pathname) is passed to matchPatterns.
Impact
This is a functional filtering bug: include/ignore rules can select or exclude unrelated files whenever a pattern collides with the repository's API pathname components. It is particularly visible when a directory pattern has the same name as the repository, but the same issue applies to any pattern intended to match only repository paths.
- Lenguaje dominante
- JavaScript
- Estrellas
- 4.5k
- Forks
- 466
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anc95/ChatGPT-CodeReview
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
anc95/ChatGPT-CodeReview#76 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
anc95/ChatGPT-CodeReview#208 ·
-
在action执行过程中有报错,action已完成但没有评论Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
anc95/ChatGPT-CodeReview#203 · 2 comentarios · 1 reacción ·
-
Rate limitPosiblemente ocupada @Br1an67 la tomó hace 237 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
anc95/ChatGPT-CodeReview#201 · 4 comentarios ·
-
IssueAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
anc95/ChatGPT-CodeReview#200 ·
Todos los issues de anc95/ChatGPT-CodeReview
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
Los mantenedores suelen responder en 1 día
-
CloudredirectAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
NanmiCoder/dsh-agent-teams#277 ·
Los mantenedores suelen responder en 1 día
-
[ordering-review] workshop order graph: 1 confirmed ordering problem, 3 cycles are false positivesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
githubnext/gh-aw-workshop#4943 ·
Los mantenedores suelen responder en 1 día