-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature - Automated pull request checks #1159
base: main
Are you sure you want to change the base?
Feature - Automated pull request checks #1159
Conversation
* Create check-pull-request-title action * Create check-pull-request-changed-files action * Add utils.js file with language and challenge functions * Add language data to data.json * Add GitHub Actions workflow to check pull requests * Add pull request title and changed file checks This commit adds two new jobs to the GitHub Actions workflow. The first job checks the title of the pull request, while the second job retrieves the changed and modified files. These changes will help ensure that the pull request meets the required criteria. * Update language names in data.json * Update pull request title validation Refactor the pull request title validation logic to use the correct input name and programming language names. This ensures that the title follows the format "#<CHALLENGE NUMBER> - <LANGUAGE NAME>". * Refactor utils.js to use object literals for challenges and programming languages * Update comments * Rename input name in check-pull-request.yml workflow * Update strings of check-pull-request-title action * Update action.yml and main.js for checking changed and modified files of a pull request * Move and rename action folders * Update file extension name in data.json * Add outputs for challenge number and programming language name based on pull request title * Add new outputs * Add Roadmap folder to pull request check This commit adds the 'Roadmap' folder to the pull request check, excluding any markdown files within it. * Refactor pull request title validation logic * Add debug statement to check changed and modified files * Create action to check changed or modified file * Refactor utils.js to add new functions and improve existing ones * Update language data in data.json * Update workflow inputs and outputs * Update inputs and outputs * Update output variable name * Update output variable names * Update programming-language description in action.yml * Refactor check-changed-or-modified-file script This commit refactors the check-changed-or-modified-file script by updating variable names and improving code readability. * Refactor utils.js to improve readability and add new functionality
* Create check-pull-request-title action * Create check-pull-request-changed-files action * Add utils.js file with language and challenge functions * Add language data to data.json * Add GitHub Actions workflow to check pull requests * Add pull request title and changed file checks This commit adds two new jobs to the GitHub Actions workflow. The first job checks the title of the pull request, while the second job retrieves the changed and modified files. These changes will help ensure that the pull request meets the required criteria. * Update language names in data.json * Update pull request title validation Refactor the pull request title validation logic to use the correct input name and programming language names. This ensures that the title follows the format "#<CHALLENGE NUMBER> - <LANGUAGE NAME>". * Refactor utils.js to use object literals for challenges and programming languages * Update comments * Rename input name in check-pull-request.yml workflow * Update strings of check-pull-request-title action * Update action.yml and main.js for checking changed and modified files of a pull request * Move and rename action folders * Update file extension name in data.json * Add outputs for challenge number and programming language name based on pull request title * Add new outputs * Add Roadmap folder to pull request check This commit adds the 'Roadmap' folder to the pull request check, excluding any markdown files within it. * Refactor pull request title validation logic * Add debug statement to check changed and modified files * Create action to check changed or modified file * Refactor utils.js to add new functions and improve existing ones * Update language data in data.json * Update workflow inputs and outputs * Update inputs and outputs * Update output variable name * Update output variable names * Update programming-language description in action.yml * Refactor check-changed-or-modified-file script This commit refactors the check-changed-or-modified-file script by updating variable names and improving code readability. * Refactor utils.js to improve readability and add new functionality * Improve error messages * Refactor code to use utility function for formatting array to string * Improve names * Improve descriptions and names * Refactor input and output names in check-changed-and-modified-files action * Refactor pull request title validation logic * Update debug message in main.js * Refactor utils.js file * Add type module to package.json * Refactor check-title/main.js for improved readability and maintainability * Add type module to package.json * Remove unused language data * Update inputs in action.yml file * Refactor file paths and inputs in check-changed-or-modified-file action * Fix pull request title format * Refactor code to improve readability and maintainability * Refactor GitHub Actions workflow This commit refactors the GitHub Actions workflow for checking pull requests. It removes unused outputs and simplifies the steps. * Add read permission to pull requests * Rename action folders
* Create check-pull-request-title action * Create check-pull-request-changed-files action * Add utils.js file with language and challenge functions * Add language data to data.json * Add GitHub Actions workflow to check pull requests * Add pull request title and changed file checks This commit adds two new jobs to the GitHub Actions workflow. The first job checks the title of the pull request, while the second job retrieves the changed and modified files. These changes will help ensure that the pull request meets the required criteria. * Update language names in data.json * Update pull request title validation Refactor the pull request title validation logic to use the correct input name and programming language names. This ensures that the title follows the format "#<CHALLENGE NUMBER> - <LANGUAGE NAME>". * Refactor utils.js to use object literals for challenges and programming languages * Update comments * Rename input name in check-pull-request.yml workflow * Update strings of check-pull-request-title action * Update action.yml and main.js for checking changed and modified files of a pull request * Move and rename action folders * Update file extension name in data.json * Add outputs for challenge number and programming language name based on pull request title * Add new outputs * Add Roadmap folder to pull request check This commit adds the 'Roadmap' folder to the pull request check, excluding any markdown files within it. * Refactor pull request title validation logic * Add debug statement to check changed and modified files * Create action to check changed or modified file * Refactor utils.js to add new functions and improve existing ones * Update language data in data.json * Update workflow inputs and outputs * Update inputs and outputs * Update output variable name * Update output variable names * Update programming-language description in action.yml * Refactor check-changed-or-modified-file script This commit refactors the check-changed-or-modified-file script by updating variable names and improving code readability. * Refactor utils.js to improve readability and add new functionality * Improve error messages * Refactor code to use utility function for formatting array to string * Improve names * Improve descriptions and names * Refactor input and output names in check-changed-and-modified-files action * Refactor pull request title validation logic * Update debug message in main.js * Refactor utils.js file * Add type module to package.json * Refactor check-title/main.js for improved readability and maintainability * Add type module to package.json * Remove unused language data * Update inputs in action.yml file * Refactor file paths and inputs in check-changed-or-modified-file action * Fix pull request title format * Refactor code to improve readability and maintainability * Refactor GitHub Actions workflow This commit refactors the GitHub Actions workflow for checking pull requests. It removes unused outputs and simplifies the steps. * Add read permission to pull requests * Rename action folders * Change jobs order * Fix roadmapPath * Add separator option to get committed files * Update splitting of committed files * Add ref on checkouts
* Create check-pull-request-title action * Create check-pull-request-changed-files action * Add utils.js file with language and challenge functions * Add language data to data.json * Add GitHub Actions workflow to check pull requests * Add pull request title and changed file checks This commit adds two new jobs to the GitHub Actions workflow. The first job checks the title of the pull request, while the second job retrieves the changed and modified files. These changes will help ensure that the pull request meets the required criteria. * Update language names in data.json * Update pull request title validation Refactor the pull request title validation logic to use the correct input name and programming language names. This ensures that the title follows the format "#<CHALLENGE NUMBER> - <LANGUAGE NAME>". * Refactor utils.js to use object literals for challenges and programming languages * Update comments * Rename input name in check-pull-request.yml workflow * Update strings of check-pull-request-title action * Update action.yml and main.js for checking changed and modified files of a pull request * Move and rename action folders * Update file extension name in data.json * Add outputs for challenge number and programming language name based on pull request title * Add new outputs * Add Roadmap folder to pull request check This commit adds the 'Roadmap' folder to the pull request check, excluding any markdown files within it. * Refactor pull request title validation logic * Add debug statement to check changed and modified files * Create action to check changed or modified file * Refactor utils.js to add new functions and improve existing ones * Update language data in data.json * Update workflow inputs and outputs * Update inputs and outputs * Update output variable name * Update output variable names * Update programming-language description in action.yml * Refactor check-changed-or-modified-file script This commit refactors the check-changed-or-modified-file script by updating variable names and improving code readability. * Refactor utils.js to improve readability and add new functionality * Improve error messages * Refactor code to use utility function for formatting array to string * Improve names * Improve descriptions and names * Refactor input and output names in check-changed-and-modified-files action * Refactor pull request title validation logic * Update debug message in main.js * Refactor utils.js file * Add type module to package.json * Refactor check-title/main.js for improved readability and maintainability * Add type module to package.json * Remove unused language data * Update inputs in action.yml file * Refactor file paths and inputs in check-changed-or-modified-file action * Fix pull request title format * Refactor code to improve readability and maintainability * Refactor GitHub Actions workflow This commit refactors the GitHub Actions workflow for checking pull requests. It removes unused outputs and simplifies the steps. * Add read permission to pull requests * Rename action folders * Change jobs order * Fix roadmapPath * Add separator option to get committed files * Update splitting of committed files * Add ref on checkouts * Fix regex
Hola! Muchísimas gracias por el trabajo 🙌 A día de hoy tenemos un problema, delegar toda la revisión en el sistema exige que el usuario realice PR perfectas, y creo que estamos lejos de eso. Prefiero primar que la gente colabore a exigirles muchos cambios. Siendo realistas, aunque se recomiendan varias cosas, lo esencial, si no me equivoco, sería esto:
¿Cómo lo ves de factible? |
Hola! |
…with the author name case insensitive
…tps://github.com/hozlucas28/Programming-Challenges-2024 into feature/hozlucas28-automated-pull-request-checks
Buenas! Modifique la GitHub action para que verifique solamente los aspectos esenciales de las Pull Requests, como dijo el patrón (@mouredev). Pudiendo enviar más de una corrección. @Roswell468 también he agregado la condición que verifica que el nombre de la carpeta del lenguaje de programación sea en minúsculas. La compara con las existentes, ya que estas se encuentran en minúsculas. Además, arregle un pequeño bug en la función que obtenía las carpetas de los lenguajes de programación, ya que no captaba aquellas que en su nombre tenían un En base al código todos los lenguajes existentes en el repositorio remoto deberían pasar la verificación de existencia de la GitHub Action. Si el lenguaje no existiera, un administrador debería mergear manualmente la Pull Request, solucionando el fallo para las siguientes ejecuciones de la GitHub Action. Realizare los test para asegurarme que todo funcione correctamente. Les notificare. |
Test concluidos 🧪Luego de realizar algunos ajustes todos los Test de la GitHub Action concluyeron exitosamente. A continuación una breve descripción de estos, junto con sus respectivos enlaces:
Si se concreta el Merge recomiendo realizar un Squash de la Pull Request. Debido a que realize un Merge sin querer con una rama de mi Fork, y aunque logre revertirlo, se conservaron commits basura que ensuciarían el historial de Commits de la rama Main. Warning Si se quisiera que la GitHub Action realize el Push automáticamente de la Pull Request, solo si las condiciones esperadas se cumplieron, se debería agregar un nuevo Step al Job: check-committed-files. Debido a que se trata de una acción peligrosa, en caso de que se realize el Merge, recomiendo observar el comportamiento de la GitHub Action durante una semana para decidir si incorporar el Push automático o no. |
Descripción de la Pull Request
GitHub Action que comprueba las Pull Requests, en base a los lineamientos establecidos. Si se desea, se podría configurar el repositorio para que el merge se realize automáticamente al finalizar exitosamente la GitHub Action de la Pull Request.
¿Cómo funciona?
Una vez abierta, editada, reabierta o sincronizada una Pull Request donde se vea afectada la carpeta Roadmap se inicia el flujo de trabajo Check pull request. Ejecutando los siguientes trabajos:
#<NÚMERO DE DESAFÍO> - <NOMBRE DEL LENGUAJE DE PROGRAMACIÓN>
.Note
La GitHub Action no se ejecutara si la Pull Request no afecta a la carpeta Roadmap ó si los archivos afectados son Markdowns.
Important
Si un trabajo falla, se detiene la ejecución de los siguientes y se notifica el error en las verificaciones de la Pull Request.
Archivos relevantes
FAQ
¿Por qué se modifico la plantilla de las Pull Requests?
Se modifico con el fin de evitar el inicio indeseado de la GitHub Action al actualizar las casillas de verificación. Además, se corrigió un error ortográfico.
¿Desde donde se obtienen los datos para corroborar la Pull Request?
La información necesaria para corroborar la Pull Request se extrae del contenido de la carpeta Roadmap del repositorio remoto. Gracias a una serie de funciones presentes en utils.mjs.
Imágenes