Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Include/ignore patterns are matched against the GitHub API URL instead of the repository-relative path

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

@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
Área
backend, devtools

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

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 anc95/ChatGPT-CodeReview

Todos los issues de anc95/ChatGPT-CodeReview

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.