This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |