diff --git a/.github/workflows/Reviw-Rover.yml b/.github/workflows/Reviw-Rover.yml new file mode 100644 index 00000000..5396a9bf --- /dev/null +++ b/.github/workflows/Reviw-Rover.yml @@ -0,0 +1,61 @@ +name: Create ZIP of pull request + +on: + pull_request: + types: [opened, synchronize] + +jobs: + create-zip: + runs-on: ubuntu-latest + steps: + - name: Clonar repositorio + uses: actions/checkout@v2 + + - name: Extraer información de publications.js + run: | + repositoryURL=$(jq -e -r '.repositoryURL' publications.json) + language=$(jq -e -r '.language' publications.json) + symbol=$(jq -e -r '.symbol' publications.json) + year=$(jq -e -r '.year' publications.json) + + echo "``` + { + "repositoryURL": "${{repositoryURL}}", + "branch": "${{ github.event.pull_request.head.ref }}", + "author": "${{ github.event.pull_request.head.user.login }}" + "language": "${language}", + "symbol": "${symbol}", + "year": "${year}" + } + ```" > publications.js + + - name: Visitar repositorio del autor + run: | + git clone "${{ github.event.pull_request.head.repo.clone_url }}" + + - name: Crear archivo ZIP + run: | + zip -r publications.zip publications.js + + - name: Subir archivo ZIP + uses: actions/upload-artifact@v2 + with: + name: publications + path: publications.zip + + - name: Agregar archivo ZIP a la conversación de la solicitud de extracción + run: | + # Utiliza la API de GitHub para agregar un comentario con el archivo ZIP + curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -d '{ + "body": "Aquí tienes el archivo ZIP de la solicitud de extracción:", + "files": { + "publications.zip": "path/to/publications.zip" + } + }' + + - name: Eliminar archivo ZIP + run: | + rm publications.zip