Fix: Main test workflow fails with empty FILES variable in pull requests
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 90/100
Línea de trabajo
La lógica que falla está en .github/workflows/test.yml, alrededor de las líneas 73-77; empieza leyendo el Main test job y la ejecución fallida referenciada, y después verifica cómo los eventos push y pull_request exponen los commits que se comparan. Actualiza el paso de detección de archivos para que ambos tipos de evento produzcan las rutas data/ previstas, y confirma que el Main test workflow ya no termina por una variable FILES vacía en un pull request.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The "Main test" job in the test workflow is failing with:
Variable FILES is empty.
This occurs because the git log command used to detect changed files doesn't work correctly for pull requests.
Root Cause
The current file detection logic (line 74 in .github/workflows/test.yml):
FILES=$(git log -1 -p data/ | grep +++ | cut -d '/' -f 2-| sed -e 's|dev/null||g')
For pull requests, git log -1 examines the merge commit created by GitHub, which doesn't contain the actual file changes from the PR. This results in an empty FILES variable, causing the job to exit with code 1.
Solution
Replace the file detection logic to handle both push and pull request events correctly:
# Find out which files in data/ have been changed in the last commit
if [ "${{ github.event_name }}" == "pull_request" ]; then
# For PRs, compare against the base branch
FILES=$(git diff --name-only origin/master...HEAD -- data/ | sed -e 's|^|data/|')
else
# For pushes, use the standard git log approach
FILES=$(git log -1 -p data/ | grep +++ | cut -d '/' -f 2- | sed -e 's|dev/null||g')
fi
echo "Last changed files from the FILES variable:"
echo "$FILES"
if [ -z "$FILES" ]; then
echo "Variable FILES is empty."
exit 1
fi
This approach:
- For PRs: Uses
git diff --name-only origin/master...HEAD -- data/to compare the PR branch against the base branch, correctly identifying changed files - For pushes: Maintains the existing logic
- Ensures files are properly formatted with the
data/prefix
Apply this change to lines 73-77 of .github/workflows/test.yml
Failure Reference
https://github.com/AppImage/appimage.github.io/actions/runs/31879003988/job/94998828969
- Lenguaje dominante
- Shell
- Estrellas
- 419
- Forks
- 813
- Merge medio
- 11 h 21 min
- PR fusionados (30 d)
- 382
Preparar el entorno
- Sin Dockerfile ni 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 AppImage/appimage.github.io
-
entry-unavailable
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AppImage/appimage.github.io#9570 ·
Los mantenedores suelen responder en 1 día
-
entry-unavailable
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
AppImage/appimage.github.io#9569 ·
Los mantenedores suelen responder en 1 día
-
entry-unavailable
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AppImage/appimage.github.io#9568 ·
Los mantenedores suelen responder en 1 día
-
entry-unavailable
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AppImage/appimage.github.io#9567 ·
Los mantenedores suelen responder en 1 día
-
entry-unavailable
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
AppImage/appimage.github.io#9566 ·
Los mantenedores suelen responder en 1 día
Todos los issues de AppImage/appimage.github.io
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 71/100
t4t5/omdrop-owl#14 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
docs(evals): note CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS for headless eval runs that use workflowsAbiertogood first issue needs-triage priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
melodic-software/claude-code-plugins#7022 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug(backend): `make test-update` in backend/src/v2 fails because the --update flag was removedAbiertoready
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
kubeflow/pipelines#14784 · 1 comentario ·
Los mantenedores suelen responder en 2 días